~kdub/mir/fix-1301040

« back to all changes in this revision

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

  • Committer: Tarmac
  • Author(s): Alan Griffiths
  • Date: 2014-04-01 17:40:49 UTC
  • mfrom: (1513.3.10 mir1)
  • Revision ID: tarmac-20140401174049-vj1jmakptw9v31qg
scene: Simplify BasicSurface creation by separating out an initial cut of SurfaceObserver.

Approved by Andreas Pokorny, Alexandros Frantzis, Gerry Boland, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
84
84
    mtd::NullEventSink sender;
85
85
    mtd::MockSurfaceFactory surface_factory;
86
86
 
87
 
    EXPECT_CALL(surface_factory, create_surface(_, _, _, _))
 
87
    EXPECT_CALL(surface_factory, create_surface(_, _, _))
88
88
        .WillOnce(Return(mock_surface));
89
89
 
90
90
    mtd::MockSessionListener listener;
115
115
 
116
116
    mtd::NullEventSink sender;
117
117
    mtd::MockSurfaceFactory surface_factory;
118
 
    ON_CALL(surface_factory, create_surface(_,_,_,_)).WillByDefault(Return(mock_surface));
 
118
    ON_CALL(surface_factory, create_surface(_,_,_)).WillByDefault(Return(mock_surface));
119
119
 
120
 
    EXPECT_CALL(surface_factory, create_surface(_, _, _, _));
 
120
    EXPECT_CALL(surface_factory, create_surface(_, _, _));
121
121
 
122
122
    mtd::MockSessionListener listener;
123
123
    EXPECT_CALL(listener, surface_created(_, _)).Times(1);
146
146
 
147
147
    {
148
148
        InSequence seq;
149
 
        EXPECT_CALL(surface_factory, create_surface(_, _, _, _)).Times(1)
150
 
            .WillOnce(Return(make_mock_surface()));
151
 
        EXPECT_CALL(surface_factory, create_surface(_, _, _, _)).Times(1)
152
 
            .WillOnce(Return(make_mock_surface()));
153
 
        EXPECT_CALL(surface_factory, create_surface(_, _, _, _)).Times(1)
 
149
        EXPECT_CALL(surface_factory, create_surface(_, _, _)).Times(1)
 
150
            .WillOnce(Return(make_mock_surface()));
 
151
        EXPECT_CALL(surface_factory, create_surface(_, _, _)).Times(1)
 
152
            .WillOnce(Return(make_mock_surface()));
 
153
        EXPECT_CALL(surface_factory, create_surface(_, _, _)).Times(1)
154
154
            .WillOnce(Return(make_mock_surface()));
155
155
    }
156
156
 
189
189
    auto mock_surface = make_mock_surface();
190
190
 
191
191
    mtd::MockSurfaceFactory surface_factory;
192
 
    ON_CALL(surface_factory, create_surface(_, _, _, _)).WillByDefault(Return(mock_surface));
 
192
    ON_CALL(surface_factory, create_surface(_, _, _)).WillByDefault(Return(mock_surface));
193
193
 
194
194
    ms::ApplicationSession app_session(
195
195
        mt::fake_shared(surface_factory),
199
199
        std::make_shared<msh::NullSessionListener>(),
200
200
        mt::fake_shared(sender));
201
201
 
202
 
    EXPECT_CALL(surface_factory, create_surface(_, _, _, _));
 
202
    EXPECT_CALL(surface_factory, create_surface(_, _, _));
203
203
 
204
204
    {
205
205
        InSequence seq;
269
269
        std::static_pointer_cast<msh::SurfaceBufferAccess>(default_surface);
270
270
    auto const snapshot_strategy = std::make_shared<MockSnapshotStrategy>();
271
271
 
272
 
    EXPECT_CALL(surface_factory, create_surface(_,_,_,_))
 
272
    EXPECT_CALL(surface_factory, create_surface(_,_,_))
273
273
        .WillOnce(Return(default_surface));
274
274
 
275
275
    EXPECT_CALL(*snapshot_strategy,