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

« back to all changes in this revision

Viewing changes to tests/unit-tests/scene/test_prompt_session_manager.cpp

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Daniel van Vugt
  • Date: 2014-07-17 07:58:53 UTC
  • mfrom: (1.1.67)
  • Revision ID: package-import@ubuntu.com-20140717075853-s4i71ob3iq4ns49z
Tags: 0.5.0+14.10.20140717-0ubuntu1
[ Daniel van Vugt ]
* New upstream release 0.5.0 (https://launchpad.net/mir/+milestone/0.5.0)
  - mirclient ABI unchanged at 8. Clients do not need rebuilding.
  - mirserver ABI bumped to 23. Servers need rebuilding, but probably don't
    need modification:
    . DefaultServerConfiguration/Cursor API: Cursor interfaces changed, most
      notably CursorImages moved from ::mir::graphics to ::mir::input.
    . DefaultServerConfiguration: New "prompt" API.
    . DefaultServerConfiguration: "clock" member is now static.
    . SessionAuthorizer: New functions.
    . ServerConfiguration: New function added: the_prompt_connector().
  - Enhancements:
    . Add AddressSanitizer cmake build type.
    . frontend, client API, tests: add support for prompt session
      permissions and for client detecting errors.
    . server: Ensure our emergency cleanup handling infrastructure is
      signal-safe.
    . Implement and enable an xcursor based image loader for cursors.
    . Fix warnings raised by the new g++-4.9.
    . shared, scene: Introduce a generic listener collection.
    . MirMotionEvent: Define a struct typedef to allow for
      pointer_coordinates to be used individually.
  - Bugs fixed:
    . Nexus 10 leaks during overlay operations (LP: #1331769)
    . MultiThreadedCompositor deadlocks (LP: #1335311)
    . Intermittent test failure in ClientSurfaceEvents can client query 
      orientation (LP: #1335741)
    . Intermittent test failure in ClientSurfaceEvents/OrientationEvents
      (LP: #1335752)
    . Intermittent memory error in ClientSurfaceEvents on
      orientation query (LP: #1335819)
    . mir_unit_tests.EventDistributorTest.* SEGFAULT (LP: #1338902)
    . [regression] Device locks randomly on welcome screen (LP: #1339700)
    . Intermittent deadlock when switching to session with custom display
      config & closing other session (LP: #1340669)
    . Mir cursor has no hotspot setting, assumes (0, 0) (LP: #1189775)
    . clang built mir_unit_tests.ProtobufSocketCommunicatorFD crashes
      intermittently (LP: #1300653)
    . g++-4.9 binary incompatibilities with libraries built with g++-4.8
      (LP: #1329089)
    . [test regression] SurfaceLoop fails sporadically on deleting surfaces
      for a disconnecting client (LP: #1335747)
    . Intermittent test failure ServerShutdown when clients are blocked
      (LP: #1335873)
    . [regression] mir_demo_client_multiwin is displayed with obviously
      wrong colours (LP: #1339471)
    . Partially onscreen surfaces not occluded when covered by another
      surface (LP: #1340078)
    . SurfaceConfigurator::attribute_set always say "unfocused" for focus
      property changes (LP: #1336548)

Show diffs side-by-side

added added

removed removed

Lines of Context:
166
166
        std::runtime_error);
167
167
}
168
168
 
169
 
TEST_F(PromptSessionManager, no_exception_when_adding_a_prompt_provider_by_pid)
170
 
{
171
 
    EXPECT_NO_THROW(session_manager.add_prompt_provider_by_pid(prompt_session, prompt_provider_pid));
172
 
}
173
 
 
174
 
TEST_F(PromptSessionManager, no_exception_on_adding_a_prompt_provider_by_pid_twice)
175
 
{
176
 
    session_manager.add_prompt_provider_by_pid(prompt_session, prompt_provider_pid);
177
 
    EXPECT_NO_THROW(session_manager.add_prompt_provider_by_pid(prompt_session, prompt_provider_pid));
178
 
}
179
 
 
180
 
TEST_F(PromptSessionManager, thows_exception_when_adding_a_prompt_provider_by_pid_with_stopped_prompt_session)
181
 
{
182
 
    session_manager.stop_prompt_session(prompt_session);
183
 
 
184
 
    EXPECT_THROW(
185
 
        session_manager.add_prompt_provider_by_pid(prompt_session, prompt_provider_pid),
186
 
        std::runtime_error);
187
 
}
188
 
 
189
 
TEST_F(PromptSessionManager, notifies_session_beginning_when_prompt_provider_is_not_in_existing_sessions)
190
 
{
191
 
    session_manager.add_prompt_provider_by_pid(prompt_session, prompt_provider_pid);
192
 
 
193
 
    EXPECT_CALL(prompt_session_listener, prompt_provider_added(Ref(*prompt_session), Eq(provider_session))).Times(1);
194
 
 
195
 
    session_manager.add_expected_session(provider_session);
196
 
}
197
 
 
198
 
TEST_F(PromptSessionManager, notifies_session_beginning_when_prompt_provider_is_in_existing_sessions)
199
 
{
200
 
    existing_sessions.insert_session(provider_session);
201
 
 
202
 
    EXPECT_CALL(prompt_session_listener, prompt_provider_added(Ref(*prompt_session), Eq(provider_session))).Times(1);
203
 
 
204
 
    session_manager.add_prompt_provider_by_pid(prompt_session, prompt_provider_pid);
205
 
}
206
 
 
207
 
TEST_F(PromptSessionManager, notifies_session_added_and_removed)
208
 
{
209
 
    session_manager.add_prompt_provider_by_pid(prompt_session, prompt_provider_pid);
210
 
 
211
 
    InSequence seq;
212
 
    EXPECT_CALL(prompt_session_listener, prompt_provider_added(Ref(*prompt_session), Eq(provider_session))).Times(1);
213
 
    EXPECT_CALL(prompt_session_listener, prompt_provider_removed(Ref(*prompt_session), Eq(provider_session))).Times(1);
214
 
 
215
 
    session_manager.add_expected_session(provider_session);
216
 
    session_manager.stop_prompt_session(prompt_session);
217
 
}
218
 
 
219
169
TEST_F(PromptSessionManager, can_iterate_over_prompt_providers_in_a_prompt_session)
220
170
{
221
171
    session_manager.add_prompt_provider(prompt_session, provider_session);
269
219
    session_manager.add_prompt_provider(prompt_session, provider_session);
270
220
    session_manager.remove_session(provider_session);
271
221
    session_manager.stop_prompt_session(prompt_session);
272
 
}
 
 
b'\\ No newline at end of file'
 
222
}