~hikiko/mir/mir.unity8-desktop-session

« back to all changes in this revision

Viewing changes to tests/unit-tests/graphics/android/test_hwc_device.cpp

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, kg, Robert Ancell, Kevin Gunn, Daniel d'Andrada, Robert Carr, Ubuntu daily release
  • Date: 2013-10-03 06:34:41 UTC
  • mfrom: (1.1.45)
  • Revision ID: package-import@ubuntu.com-20131003063441-t4qn849kkzztps9s
Tags: 0.0.13+13.10.20131003-0ubuntu1
[ kg ]
* bump version for ABI break (LP: #1229212)

[ Robert Ancell ]
* Bump version to 0.0.12

[ Kevin Gunn ]
* bump version to 0.0.13

[ Daniel d'Andrada ]
* Fix for LP#1233944 Fixes the Mir-side of bug
  https://bugs.launchpad.net/mir/+bug/1233944 Event files are first
  created with root:root permissions and only later udev rules are
  applied to it, changing its permissions to root:android-input and
  therefore making it readable by unity8-mir in short: Retry opening a
  file when its permissions change as it might be readable now. (LP:
  #1233944)

[ Robert Carr ]
* Fix for LP#1233944 Fixes the Mir-side of bug
  https://bugs.launchpad.net/mir/+bug/1233944 Event files are first
  created with root:root permissions and only later udev rules are
  applied to it, changing its permissions to root:android-input and
  therefore making it readable by unity8-mir in short: Retry opening a
  file when its permissions change as it might be readable now. (LP:
  #1233944)

[ Ubuntu daily release ]
* Automatic snapshot from revision 1089

Show diffs side-by-side

added added

removed removed

Lines of Context:
176
176
    }, std::runtime_error);
177
177
}
178
178
 
179
 
TYPED_TEST(HWCCommon, test_hwc_throws_on_blank_or_unblank_error)
 
179
TYPED_TEST(HWCCommon, test_hwc_throws_on_blanking_error)
180
180
{
181
181
    using namespace testing;
182
182
 
194
194
    auto device = make_hwc_device<TypeParam>(this->mock_device, this->mock_layer_list,
195
195
                                             this->mock_fbdev, this->mock_vsync);
196
196
    EXPECT_THROW({
197
 
            device->blank_or_unblank_screen(true);
 
197
        device->mode(mir_power_mode_off);
198
198
    }, std::runtime_error);
199
199
}
200
200
 
 
201
TYPED_TEST(HWCCommon, test_hwc_suspend_standby_turn_off)
 
202
{
 
203
    using namespace testing;
 
204
 
 
205
    EXPECT_CALL(*this->mock_device, blank_interface(this->mock_device.get(), HWC_DISPLAY_PRIMARY, 0))
 
206
        .Times(3)
 
207
        .WillOnce(Return(0));
 
208
    EXPECT_CALL(*this->mock_device, blank_interface(this->mock_device.get(), HWC_DISPLAY_PRIMARY, 1))
 
209
        .Times(3)
 
210
        .WillOnce(Return(0));
 
211
 
 
212
    auto device = make_hwc_device<TypeParam>(this->mock_device, this->mock_layer_list,
 
213
                                             this->mock_fbdev, this->mock_vsync);
 
214
    device->mode(mir_power_mode_off);
 
215
    device->mode(mir_power_mode_on);
 
216
    device->mode(mir_power_mode_suspend);
 
217
    device->mode(mir_power_mode_on);
 
218
    device->mode(mir_power_mode_standby);
 
219
}
 
220
 
 
221
TYPED_TEST(HWCCommon, test_hwc_deactivates_vsync_on_blank)
 
222
{
 
223
    using namespace testing;
 
224
 
 
225
    InSequence seq;
 
226
    EXPECT_CALL(*this->mock_device, blank_interface(this->mock_device.get(), HWC_DISPLAY_PRIMARY, 0))
 
227
        .Times(1)
 
228
        .WillOnce(Return(0));
 
229
    EXPECT_CALL(*this->mock_device, eventControl_interface(this->mock_device.get(), HWC_DISPLAY_PRIMARY, HWC_EVENT_VSYNC, 1))
 
230
        .Times(1);
 
231
 
 
232
    EXPECT_CALL(*this->mock_device, eventControl_interface(this->mock_device.get(), HWC_DISPLAY_PRIMARY, HWC_EVENT_VSYNC, 0))
 
233
        .Times(1);
 
234
    EXPECT_CALL(*this->mock_device, blank_interface(this->mock_device.get(), HWC_DISPLAY_PRIMARY, 1))
 
235
        .Times(1)
 
236
        .WillOnce(Return(0));
 
237
 
 
238
    auto device = make_hwc_device<TypeParam>(this->mock_device, this->mock_layer_list,
 
239
                                             this->mock_fbdev, this->mock_vsync);
 
240
    device->mode(mir_power_mode_off);
 
241
}
 
242
 
201
243
TYPED_TEST(HWCCommon, test_blank_is_ignored_if_already_in_correct_state)
202
244
{
203
245
    using namespace testing;
216
258
 
217
259
    auto device = make_hwc_device<TypeParam>(this->mock_device, this->mock_layer_list,
218
260
                                             this->mock_fbdev, this->mock_vsync);
219
 
    device->blank_or_unblank_screen(false);
 
261
    device->mode(mir_power_mode_on);
220
262
}
221
263
 
222
264
TYPED_TEST(HWCCommon, test_hwc_display_is_deactivated_on_destroy)