~ubuntu-branches/ubuntu/vivid/mir/vivid

« back to all changes in this revision

Viewing changes to tests/acceptance-tests/test_client_focus_notification.cpp

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release
  • Date: 2014-02-04 14:49:07 UTC
  • mto: This revision was merged to the branch mainline in revision 61.
  • Revision ID: package-import@ubuntu.com-20140204144907-o3ruhix0ey26lchl
Tags: upstream-0.1.4+14.04.20140204
ImportĀ upstreamĀ versionĀ 0.1.4+14.04.20140204

Show diffs side-by-side

added added

removed removed

Lines of Context:
120
120
        {
121
121
            EXPECT_CALL(*observer, see(Pointee(mt::SurfaceEvent(mir_surface_attrib_focus, mir_surface_focused)))).Times(1)
122
122
                .WillOnce(mt::WakeUp(all_events_received));
123
 
            EXPECT_CALL(*observer, see(Pointee(mt::SurfaceEvent(mir_surface_attrib_focus, mir_surface_unfocused)))).Times(1);
 
123
            // We may not see mir_surface_unfocused before connection closes
 
124
            EXPECT_CALL(*observer, see(Pointee(mt::SurfaceEvent(mir_surface_attrib_focus, mir_surface_unfocused)))).Times(AtMost(1));
124
125
        }
125
126
    } client_config;
126
127
    launch_client_process(client_config);
136
137
 
137
138
}
138
139
 
139
 
TEST_F(BespokeDisplayServerTestFixture, two_scene_are_notified_of_gaining_and_losing_focus)
 
140
TEST_F(BespokeDisplayServerTestFixture, two_surfaces_are_notified_of_gaining_and_losing_focus)
140
141
{
141
142
    using namespace ::testing;
142
143
 
169
170
            // And regain it when the second surface is closed
170
171
            EXPECT_CALL(*observer, see(Pointee(mt::SurfaceEvent(mir_surface_attrib_focus,
171
172
                mir_surface_focused)))).Times(1).WillOnce(mt::WakeUp(all_events_received));
172
 
            // And then lose it as we are closed
 
173
            // And then lose it as we are closed (but we may not see confirmation before connection closes)
173
174
            EXPECT_CALL(*observer, see(Pointee(mt::SurfaceEvent(mir_surface_attrib_focus,
174
 
                mir_surface_unfocused)))).Times(1);
 
175
                mir_surface_unfocused)))).Times(AtMost(1));
175
176
        }
176
177
 
177
178
    } client_one_config(ready_for_second_client);
196
197
            EXPECT_CALL(*observer, see(Pointee(
197
198
                mt::SurfaceEvent(mir_surface_attrib_focus, mir_surface_focused))))
198
199
                    .Times(1).WillOnce(mt::WakeUp(all_events_received));
 
200
            // We may not see mir_surface_unfocused before connection closes
199
201
            EXPECT_CALL(*observer, see(Pointee(
200
202
                mt::SurfaceEvent(mir_surface_attrib_focus, mir_surface_unfocused))))
201
 
                    .Times(1);
 
203
                    .Times(AtMost(1));
202
204
        }
203
205
    } client_two_config(ready_for_second_client);
204
206