1 /*
2 * Copyright 2020 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #undef LOG_TAG
18 #define LOG_TAG "LibSurfaceFlingerUnittests"
19
20 #include <com_android_graphics_surfaceflinger_flags.h>
21 #include <common/test/FlagUtils.h>
22 #include "DisplayTransactionTestHelpers.h"
23
24 #include <gmock/gmock.h>
25 #include <gtest/gtest.h>
26
27 using namespace com::android::graphics::surfaceflinger;
28
29 namespace android {
30 namespace {
31
32 MATCHER_P(DisplayModeFps, value, "equals") {
33 using fps_approx_ops::operator==;
34 return arg->getVsyncRate() == value;
35 }
36
37 // Used when we simulate a display that supports doze.
38 template <typename Display>
39 struct DozeIsSupportedVariant {
40 static constexpr bool DOZE_SUPPORTED = true;
41 static constexpr IComposerClient::PowerMode ACTUAL_POWER_MODE_FOR_DOZE =
42 IComposerClient::PowerMode::DOZE;
43 static constexpr IComposerClient::PowerMode ACTUAL_POWER_MODE_FOR_DOZE_SUSPEND =
44 IComposerClient::PowerMode::DOZE_SUSPEND;
45
setupComposerCallExpectationsandroid::__anone7b4cfe20111::DozeIsSupportedVariant46 static void setupComposerCallExpectations(DisplayTransactionTest* test) {
47 EXPECT_CALL(*test->mComposer, getDisplayCapabilities(Display::HWC_DISPLAY_ID, _))
48 .WillOnce(DoAll(SetArgPointee<1>(
49 std::vector<DisplayCapability>({DisplayCapability::DOZE})),
50 Return(Error::NONE)));
51 }
52 };
53
54 template <typename Display>
55 // Used when we simulate a display that does not support doze.
56 struct DozeNotSupportedVariant {
57 static constexpr bool DOZE_SUPPORTED = false;
58 static constexpr IComposerClient::PowerMode ACTUAL_POWER_MODE_FOR_DOZE =
59 IComposerClient::PowerMode::ON;
60 static constexpr IComposerClient::PowerMode ACTUAL_POWER_MODE_FOR_DOZE_SUSPEND =
61 IComposerClient::PowerMode::ON;
62
setupComposerCallExpectationsandroid::__anone7b4cfe20111::DozeNotSupportedVariant63 static void setupComposerCallExpectations(DisplayTransactionTest* test) {
64 EXPECT_CALL(*test->mComposer, getDisplayCapabilities(Display::HWC_DISPLAY_ID, _))
65 .WillOnce(DoAll(SetArgPointee<1>(std::vector<DisplayCapability>({})),
66 Return(Error::NONE)));
67 }
68 };
69
70 struct EventThreadBaseSupportedVariant {
setupVsyncNoCallExpectationsandroid::__anone7b4cfe20111::EventThreadBaseSupportedVariant71 static void setupVsyncNoCallExpectations(DisplayTransactionTest* test) {
72 // Expect no change to hardware nor synthetic VSYNC.
73 EXPECT_CALL(test->mFlinger.scheduler()->mockRequestHardwareVsync, Call(_, _)).Times(0);
74 EXPECT_CALL(*test->mEventThread, enableSyntheticVsync(_)).Times(0);
75 }
76 };
77
78 struct EventThreadNotSupportedVariant : public EventThreadBaseSupportedVariant {
setupEnableVsyncCallExpectationsandroid::__anone7b4cfe20111::EventThreadNotSupportedVariant79 static void setupEnableVsyncCallExpectations(DisplayTransactionTest* test) {
80 EXPECT_CALL(test->mFlinger.scheduler()->mockRequestHardwareVsync, Call(_, true)).Times(1);
81 EXPECT_CALL(*test->mEventThread, enableSyntheticVsync(_)).Times(0);
82 }
83
setupDisableVsyncCallExpectationsandroid::__anone7b4cfe20111::EventThreadNotSupportedVariant84 static void setupDisableVsyncCallExpectations(DisplayTransactionTest* test) {
85 EXPECT_CALL(test->mFlinger.scheduler()->mockRequestHardwareVsync, Call(_, false)).Times(1);
86 EXPECT_CALL(*test->mEventThread, enableSyntheticVsync(_)).Times(0);
87 }
88 };
89
90 struct EventThreadIsSupportedVariant : public EventThreadBaseSupportedVariant {
setupEnableVsyncCallExpectationsandroid::__anone7b4cfe20111::EventThreadIsSupportedVariant91 static void setupEnableVsyncCallExpectations(DisplayTransactionTest* test) {
92 // Expect to enable hardware VSYNC and disable synthetic VSYNC.
93 EXPECT_CALL(test->mFlinger.scheduler()->mockRequestHardwareVsync, Call(_, true)).Times(1);
94 EXPECT_CALL(*test->mEventThread, enableSyntheticVsync(false)).Times(1);
95 }
96
setupDisableVsyncCallExpectationsandroid::__anone7b4cfe20111::EventThreadIsSupportedVariant97 static void setupDisableVsyncCallExpectations(DisplayTransactionTest* test) {
98 // Expect to disable hardware VSYNC and enable synthetic VSYNC.
99 EXPECT_CALL(test->mFlinger.scheduler()->mockRequestHardwareVsync, Call(_, false)).Times(1);
100 EXPECT_CALL(*test->mEventThread, enableSyntheticVsync(true)).Times(1);
101 }
102 };
103
104 struct DispSyncIsSupportedVariant {
setupResetModelCallExpectationsandroid::__anone7b4cfe20111::DispSyncIsSupportedVariant105 static void setupResetModelCallExpectations(DisplayTransactionTest* test) {
106 auto vsyncSchedule = test->mFlinger.scheduler()->getVsyncSchedule();
107 EXPECT_CALL(static_cast<mock::VsyncController&>(vsyncSchedule->getController()),
108 onDisplayModeChanged(DisplayModeFps(Fps::fromPeriodNsecs(DEFAULT_VSYNC_PERIOD)),
109 false))
110 .Times(1);
111 EXPECT_CALL(static_cast<mock::VSyncTracker&>(vsyncSchedule->getTracker()), resetModel())
112 .Times(1);
113 }
114 };
115
116 struct DispSyncNotSupportedVariant {
setupResetModelCallExpectationsandroid::__anone7b4cfe20111::DispSyncNotSupportedVariant117 static void setupResetModelCallExpectations(DisplayTransactionTest* /* test */) {}
118 };
119
120 // --------------------------------------------------------------------
121 // Note:
122 //
123 // There are a large number of transitions we could test, however we only test a
124 // selected subset which provides complete test coverage of the implementation.
125 // --------------------------------------------------------------------
126
127 template <PowerMode initialPowerMode, PowerMode targetPowerMode>
128 struct TransitionVariantCommon {
129 static constexpr auto INITIAL_POWER_MODE = initialPowerMode;
130 static constexpr auto TARGET_POWER_MODE = targetPowerMode;
131
verifyPostconditionsandroid::__anone7b4cfe20111::TransitionVariantCommon132 static void verifyPostconditions(DisplayTransactionTest*) {}
133 };
134
135 struct TransitionOffToOnVariant : public TransitionVariantCommon<PowerMode::OFF, PowerMode::ON> {
136 template <typename Case>
setupCallExpectationsandroid::__anone7b4cfe20111::TransitionOffToOnVariant137 static void setupCallExpectations(DisplayTransactionTest* test) {
138 Case::setupComposerCallExpectations(test, IComposerClient::PowerMode::ON);
139 Case::EventThread::setupEnableVsyncCallExpectations(test);
140 Case::DispSync::setupResetModelCallExpectations(test);
141 Case::setupRepaintEverythingCallExpectations(test);
142 }
143
verifyPostconditionsandroid::__anone7b4cfe20111::TransitionOffToOnVariant144 static void verifyPostconditions(DisplayTransactionTest* test) {
145 EXPECT_TRUE(test->mFlinger.getVisibleRegionsDirty());
146 }
147 };
148
149 struct TransitionOffToDozeSuspendVariant
150 : public TransitionVariantCommon<PowerMode::OFF, PowerMode::DOZE_SUSPEND> {
151 template <typename Case>
setupCallExpectationsandroid::__anone7b4cfe20111::TransitionOffToDozeSuspendVariant152 static void setupCallExpectations(DisplayTransactionTest* test) {
153 Case::setupComposerCallExpectations(test, Case::Doze::ACTUAL_POWER_MODE_FOR_DOZE_SUSPEND);
154 Case::EventThread::setupVsyncNoCallExpectations(test);
155 Case::setupRepaintEverythingCallExpectations(test);
156 }
157
verifyPostconditionsandroid::__anone7b4cfe20111::TransitionOffToDozeSuspendVariant158 static void verifyPostconditions(DisplayTransactionTest* test) {
159 EXPECT_TRUE(test->mFlinger.getVisibleRegionsDirty());
160 }
161 };
162
163 struct TransitionOnToOffVariant : public TransitionVariantCommon<PowerMode::ON, PowerMode::OFF> {
164 template <typename Case>
setupCallExpectationsandroid::__anone7b4cfe20111::TransitionOnToOffVariant165 static void setupCallExpectations(DisplayTransactionTest* test) {
166 Case::EventThread::setupDisableVsyncCallExpectations(test);
167 Case::setupComposerCallExpectations(test, IComposerClient::PowerMode::OFF);
168 }
169
verifyPostconditionsandroid::__anone7b4cfe20111::TransitionOnToOffVariant170 static void verifyPostconditions(DisplayTransactionTest* test) {
171 EXPECT_TRUE(test->mFlinger.getVisibleRegionsDirty());
172 }
173 };
174
175 struct TransitionDozeSuspendToOffVariant
176 : public TransitionVariantCommon<PowerMode::DOZE_SUSPEND, PowerMode::OFF> {
177 template <typename Case>
setupCallExpectationsandroid::__anone7b4cfe20111::TransitionDozeSuspendToOffVariant178 static void setupCallExpectations(DisplayTransactionTest* test) {
179 Case::EventThread::setupVsyncNoCallExpectations(test);
180 Case::setupComposerCallExpectations(test, IComposerClient::PowerMode::OFF);
181 }
182
verifyPostconditionsandroid::__anone7b4cfe20111::TransitionDozeSuspendToOffVariant183 static void verifyPostconditions(DisplayTransactionTest* test) {
184 EXPECT_TRUE(test->mFlinger.getVisibleRegionsDirty());
185 }
186 };
187
188 struct TransitionOnToDozeVariant : public TransitionVariantCommon<PowerMode::ON, PowerMode::DOZE> {
189 template <typename Case>
setupCallExpectationsandroid::__anone7b4cfe20111::TransitionOnToDozeVariant190 static void setupCallExpectations(DisplayTransactionTest* test) {
191 Case::EventThread::setupVsyncNoCallExpectations(test);
192 Case::setupComposerCallExpectations(test, Case::Doze::ACTUAL_POWER_MODE_FOR_DOZE);
193 }
194 };
195
196 struct TransitionDozeSuspendToDozeVariant
197 : public TransitionVariantCommon<PowerMode::DOZE_SUSPEND, PowerMode::DOZE> {
198 template <typename Case>
setupCallExpectationsandroid::__anone7b4cfe20111::TransitionDozeSuspendToDozeVariant199 static void setupCallExpectations(DisplayTransactionTest* test) {
200 Case::EventThread::setupEnableVsyncCallExpectations(test);
201 Case::DispSync::setupResetModelCallExpectations(test);
202 Case::setupComposerCallExpectations(test, Case::Doze::ACTUAL_POWER_MODE_FOR_DOZE);
203 }
204 };
205
206 struct TransitionDozeToOnVariant : public TransitionVariantCommon<PowerMode::DOZE, PowerMode::ON> {
207 template <typename Case>
setupCallExpectationsandroid::__anone7b4cfe20111::TransitionDozeToOnVariant208 static void setupCallExpectations(DisplayTransactionTest* test) {
209 Case::EventThread::setupVsyncNoCallExpectations(test);
210 Case::setupComposerCallExpectations(test, IComposerClient::PowerMode::ON);
211 }
212 };
213
214 struct TransitionDozeSuspendToOnVariant
215 : public TransitionVariantCommon<PowerMode::DOZE_SUSPEND, PowerMode::ON> {
216 template <typename Case>
setupCallExpectationsandroid::__anone7b4cfe20111::TransitionDozeSuspendToOnVariant217 static void setupCallExpectations(DisplayTransactionTest* test) {
218 Case::EventThread::setupEnableVsyncCallExpectations(test);
219 Case::DispSync::setupResetModelCallExpectations(test);
220 Case::setupComposerCallExpectations(test, IComposerClient::PowerMode::ON);
221 }
222 };
223
224 struct TransitionOnToDozeSuspendVariant
225 : public TransitionVariantCommon<PowerMode::ON, PowerMode::DOZE_SUSPEND> {
226 template <typename Case>
setupCallExpectationsandroid::__anone7b4cfe20111::TransitionOnToDozeSuspendVariant227 static void setupCallExpectations(DisplayTransactionTest* test) {
228 Case::EventThread::setupDisableVsyncCallExpectations(test);
229 Case::setupComposerCallExpectations(test, Case::Doze::ACTUAL_POWER_MODE_FOR_DOZE_SUSPEND);
230 }
231 };
232
233 struct TransitionOnToUnknownVariant
234 : public TransitionVariantCommon<PowerMode::ON, static_cast<PowerMode>(POWER_MODE_LEET)> {
235 template <typename Case>
setupCallExpectationsandroid::__anone7b4cfe20111::TransitionOnToUnknownVariant236 static void setupCallExpectations(DisplayTransactionTest* test) {
237 Case::EventThread::setupVsyncNoCallExpectations(test);
238 Case::setupNoComposerPowerModeCallExpectations(test);
239 }
240 };
241
242 // --------------------------------------------------------------------
243 // Note:
244 //
245 // Rather than testing the cartesian product of
246 // DozeIsSupported/DozeNotSupported with all other options, we use one for one
247 // display type, and the other for another display type.
248 // --------------------------------------------------------------------
249
250 template <typename DisplayVariant, typename DozeVariant, typename EventThreadVariant,
251 typename DispSyncVariant, typename TransitionVariant>
252 struct DisplayPowerCase {
253 using Display = DisplayVariant;
254 using Doze = DozeVariant;
255 using EventThread = EventThreadVariant;
256 using DispSync = DispSyncVariant;
257 using Transition = TransitionVariant;
258
injectDisplayWithInitialPowerModeandroid::__anone7b4cfe20111::DisplayPowerCase259 static sp<DisplayDevice> injectDisplayWithInitialPowerMode(DisplayTransactionTest* test,
260 PowerMode mode) {
261 Display::injectHwcDisplayWithNoDefaultCapabilities(test);
262 auto injector = Display::makeFakeExistingDisplayInjector(test);
263 const auto display = injector.inject();
264 display->setPowerMode(mode);
265 return display;
266 }
267
setInitialHwVsyncEnabledandroid::__anone7b4cfe20111::DisplayPowerCase268 static void setInitialHwVsyncEnabled(DisplayTransactionTest* test, PhysicalDisplayId id,
269 bool enabled) {
270 test->mFlinger.scheduler()->setInitialHwVsyncEnabled(id, enabled);
271 }
272
setupRepaintEverythingCallExpectationsandroid::__anone7b4cfe20111::DisplayPowerCase273 static void setupRepaintEverythingCallExpectations(DisplayTransactionTest* test) {
274 EXPECT_CALL(*test->mFlinger.scheduler(), scheduleFrame(_)).Times(1);
275 }
276
setupComposerCallExpectationsandroid::__anone7b4cfe20111::DisplayPowerCase277 static void setupComposerCallExpectations(DisplayTransactionTest* test, PowerMode mode) {
278 // Any calls to get the active config will return a default value.
279 EXPECT_CALL(*test->mComposer, getActiveConfig(Display::HWC_DISPLAY_ID, _))
280 .WillRepeatedly(DoAll(SetArgPointee<1>(Display::HWC_ACTIVE_CONFIG_ID),
281 Return(Error::NONE)));
282
283 // Any calls to get whether the display supports dozing will return the value set by the
284 // policy variant.
285 EXPECT_CALL(*test->mComposer, getDozeSupport(Display::HWC_DISPLAY_ID, _))
286 .WillRepeatedly(DoAll(SetArgPointee<1>(Doze::DOZE_SUPPORTED), Return(Error::NONE)));
287
288 EXPECT_CALL(*test->mComposer, setPowerMode(Display::HWC_DISPLAY_ID, mode)).Times(1);
289 }
290
setupNoComposerPowerModeCallExpectationsandroid::__anone7b4cfe20111::DisplayPowerCase291 static void setupNoComposerPowerModeCallExpectations(DisplayTransactionTest* test) {
292 EXPECT_CALL(*test->mComposer, setPowerMode(Display::HWC_DISPLAY_ID, _)).Times(0);
293 }
294 };
295
296 // A sample configuration for the primary display.
297 // In addition to having event thread support, we emulate doze support.
298 template <typename TransitionVariant>
299 using PrimaryDisplayPowerCase =
300 DisplayPowerCase<PrimaryDisplayVariant, DozeIsSupportedVariant<PrimaryDisplayVariant>,
301 EventThreadIsSupportedVariant, DispSyncIsSupportedVariant,
302 TransitionVariant>;
303
304 // A sample configuration for the external display.
305 // In addition to not having event thread support, we emulate not having doze
306 // support.
307 // TODO (b/267483230): ExternalDisplay supports the features tracked in
308 // DispSyncIsSupportedVariant, but is the follower, so the
309 // expectations set by DispSyncIsSupportedVariant don't match (wrong schedule).
310 // We need a way to retrieve the proper DisplayId from
311 // setupResetModelCallExpectations (or pass it in).
312 template <typename TransitionVariant>
313 using ExternalDisplayPowerCase =
314 DisplayPowerCase<ExternalDisplayVariant, DozeNotSupportedVariant<ExternalDisplayVariant>,
315 EventThreadNotSupportedVariant, DispSyncNotSupportedVariant,
316 TransitionVariant>;
317
318 class SetPhysicalDisplayPowerModeTest : public DisplayTransactionTest {
319 public:
320 template <typename Case>
321 void transitionDisplayCommon();
322 };
323
324 template <PowerMode PowerMode>
325 struct PowerModeInitialVSyncEnabled : public std::false_type {};
326
327 template <>
328 struct PowerModeInitialVSyncEnabled<PowerMode::ON> : public std::true_type {};
329
330 template <>
331 struct PowerModeInitialVSyncEnabled<PowerMode::DOZE> : public std::true_type {};
332
333 template <typename Case>
transitionDisplayCommon()334 void SetPhysicalDisplayPowerModeTest::transitionDisplayCommon() {
335 // --------------------------------------------------------------------
336 // Preconditions
337
338 Case::Doze::setupComposerCallExpectations(this);
339 auto display =
340 Case::injectDisplayWithInitialPowerMode(this, Case::Transition::INITIAL_POWER_MODE);
341 if (auto physicalDisplayId = asPhysicalDisplayId(display->getDisplayIdVariant())) {
342 Case::setInitialHwVsyncEnabled(this, *physicalDisplayId,
343 PowerModeInitialVSyncEnabled<
344 Case::Transition::INITIAL_POWER_MODE>::value);
345 }
346
347 // --------------------------------------------------------------------
348 // Call Expectations
349
350 Case::Transition::template setupCallExpectations<Case>(this);
351
352 // --------------------------------------------------------------------
353 // Invocation
354
355 mFlinger.setPhysicalDisplayPowerMode(display, Case::Transition::TARGET_POWER_MODE);
356
357 // --------------------------------------------------------------------
358 // Postconditions
359
360 Case::Transition::verifyPostconditions(this);
361 }
362
TEST_F(SetPhysicalDisplayPowerModeTest,setPhysicalDisplayPowerModeDoesNothingIfNoChange)363 TEST_F(SetPhysicalDisplayPowerModeTest, setPhysicalDisplayPowerModeDoesNothingIfNoChange) {
364 using Case = SimplePrimaryDisplayCase;
365
366 // --------------------------------------------------------------------
367 // Preconditions
368
369 // A primary display device is set up
370 Case::Display::injectHwcDisplay(this);
371 auto display = Case::Display::makeFakeExistingDisplayInjector(this);
372 display.inject();
373
374 // The display is already set to PowerMode::ON
375 display.mutableDisplayDevice()->setPowerMode(PowerMode::ON);
376
377 // --------------------------------------------------------------------
378 // Invocation
379
380 mFlinger.setPhysicalDisplayPowerMode(display.mutableDisplayDevice(), PowerMode::ON);
381
382 // --------------------------------------------------------------------
383 // Postconditions
384
385 EXPECT_EQ(PowerMode::ON, display.mutableDisplayDevice()->getPowerMode());
386 }
387
TEST_F(SetPhysicalDisplayPowerModeTest,setPhysicalDisplayPowerModeDoesNothingIfVirtualDisplay)388 TEST_F(SetPhysicalDisplayPowerModeTest, setPhysicalDisplayPowerModeDoesNothingIfVirtualDisplay) {
389 using Case = HwcVirtualDisplayCase;
390
391 // --------------------------------------------------------------------
392 // Preconditions
393
394 // Insert display data so that the HWC thinks it created the virtual display.
395 const auto displayId = asHalDisplayId(Case::Display::DISPLAY_ID::get());
396 ASSERT_TRUE(displayId);
397 ASSERT_TRUE(mFlinger.mutableHwcDisplayData().try_emplace(*displayId).second);
398
399 // A virtual display device is set up
400 Case::Display::injectHwcDisplay(this);
401 auto display = Case::Display::makeFakeExistingDisplayInjector(this);
402 display.inject();
403
404 // The display is set to PowerMode::ON
405 display.mutableDisplayDevice()->setPowerMode(PowerMode::ON);
406
407 // --------------------------------------------------------------------
408 // Invocation
409
410 mFlinger.setPhysicalDisplayPowerMode(display.mutableDisplayDevice(), PowerMode::OFF);
411
412 // --------------------------------------------------------------------
413 // Postconditions
414
415 EXPECT_EQ(PowerMode::ON, display.mutableDisplayDevice()->getPowerMode());
416 }
417
TEST_F(SetPhysicalDisplayPowerModeTest,transitionsDisplayFromOffToOnPrimaryDisplay)418 TEST_F(SetPhysicalDisplayPowerModeTest, transitionsDisplayFromOffToOnPrimaryDisplay) {
419 transitionDisplayCommon<PrimaryDisplayPowerCase<TransitionOffToOnVariant>>();
420 }
421
TEST_F(SetPhysicalDisplayPowerModeTest,transitionsDisplayFromOffToDozeSuspendPrimaryDisplay)422 TEST_F(SetPhysicalDisplayPowerModeTest, transitionsDisplayFromOffToDozeSuspendPrimaryDisplay) {
423 transitionDisplayCommon<PrimaryDisplayPowerCase<TransitionOffToDozeSuspendVariant>>();
424 }
425
TEST_F(SetPhysicalDisplayPowerModeTest,transitionsDisplayFromOnToOffPrimaryDisplay)426 TEST_F(SetPhysicalDisplayPowerModeTest, transitionsDisplayFromOnToOffPrimaryDisplay) {
427 transitionDisplayCommon<PrimaryDisplayPowerCase<TransitionOnToOffVariant>>();
428 }
429
TEST_F(SetPhysicalDisplayPowerModeTest,transitionsDisplayFromDozeSuspendToOffPrimaryDisplay)430 TEST_F(SetPhysicalDisplayPowerModeTest, transitionsDisplayFromDozeSuspendToOffPrimaryDisplay) {
431 transitionDisplayCommon<PrimaryDisplayPowerCase<TransitionDozeSuspendToOffVariant>>();
432 }
433
TEST_F(SetPhysicalDisplayPowerModeTest,transitionsDisplayFromOnToDozePrimaryDisplay)434 TEST_F(SetPhysicalDisplayPowerModeTest, transitionsDisplayFromOnToDozePrimaryDisplay) {
435 transitionDisplayCommon<PrimaryDisplayPowerCase<TransitionOnToDozeVariant>>();
436 }
437
TEST_F(SetPhysicalDisplayPowerModeTest,transitionsDisplayFromDozeSuspendToDozePrimaryDisplay)438 TEST_F(SetPhysicalDisplayPowerModeTest, transitionsDisplayFromDozeSuspendToDozePrimaryDisplay) {
439 transitionDisplayCommon<PrimaryDisplayPowerCase<TransitionDozeSuspendToDozeVariant>>();
440 }
441
TEST_F(SetPhysicalDisplayPowerModeTest,transitionsDisplayFromDozeToOnPrimaryDisplay)442 TEST_F(SetPhysicalDisplayPowerModeTest, transitionsDisplayFromDozeToOnPrimaryDisplay) {
443 transitionDisplayCommon<PrimaryDisplayPowerCase<TransitionDozeToOnVariant>>();
444 }
445
TEST_F(SetPhysicalDisplayPowerModeTest,transitionsDisplayFromDozeSuspendToOnPrimaryDisplay)446 TEST_F(SetPhysicalDisplayPowerModeTest, transitionsDisplayFromDozeSuspendToOnPrimaryDisplay) {
447 transitionDisplayCommon<PrimaryDisplayPowerCase<TransitionDozeSuspendToOnVariant>>();
448 }
449
TEST_F(SetPhysicalDisplayPowerModeTest,transitionsDisplayFromOnToDozeSuspendPrimaryDisplay)450 TEST_F(SetPhysicalDisplayPowerModeTest, transitionsDisplayFromOnToDozeSuspendPrimaryDisplay) {
451 transitionDisplayCommon<PrimaryDisplayPowerCase<TransitionOnToDozeSuspendVariant>>();
452 }
453
TEST_F(SetPhysicalDisplayPowerModeTest,transitionsDisplayFromOnToUnknownPrimaryDisplay)454 TEST_F(SetPhysicalDisplayPowerModeTest, transitionsDisplayFromOnToUnknownPrimaryDisplay) {
455 transitionDisplayCommon<PrimaryDisplayPowerCase<TransitionOnToUnknownVariant>>();
456 }
457
TEST_F(SetPhysicalDisplayPowerModeTest,transitionsDisplayFromOffToOnExternalDisplay)458 TEST_F(SetPhysicalDisplayPowerModeTest, transitionsDisplayFromOffToOnExternalDisplay) {
459 transitionDisplayCommon<ExternalDisplayPowerCase<TransitionOffToOnVariant>>();
460 }
461
TEST_F(SetPhysicalDisplayPowerModeTest,transitionsDisplayFromOffToDozeSuspendExternalDisplay)462 TEST_F(SetPhysicalDisplayPowerModeTest, transitionsDisplayFromOffToDozeSuspendExternalDisplay) {
463 transitionDisplayCommon<ExternalDisplayPowerCase<TransitionOffToDozeSuspendVariant>>();
464 }
465
TEST_F(SetPhysicalDisplayPowerModeTest,transitionsDisplayFromOnToOffExternalDisplay)466 TEST_F(SetPhysicalDisplayPowerModeTest, transitionsDisplayFromOnToOffExternalDisplay) {
467 transitionDisplayCommon<ExternalDisplayPowerCase<TransitionOnToOffVariant>>();
468 }
469
TEST_F(SetPhysicalDisplayPowerModeTest,transitionsDisplayFromDozeSuspendToOffExternalDisplay)470 TEST_F(SetPhysicalDisplayPowerModeTest, transitionsDisplayFromDozeSuspendToOffExternalDisplay) {
471 transitionDisplayCommon<ExternalDisplayPowerCase<TransitionDozeSuspendToOffVariant>>();
472 }
473
TEST_F(SetPhysicalDisplayPowerModeTest,transitionsDisplayFromOnToDozeExternalDisplay)474 TEST_F(SetPhysicalDisplayPowerModeTest, transitionsDisplayFromOnToDozeExternalDisplay) {
475 transitionDisplayCommon<ExternalDisplayPowerCase<TransitionOnToDozeVariant>>();
476 }
477
TEST_F(SetPhysicalDisplayPowerModeTest,transitionsDisplayFromDozeSuspendToDozeExternalDisplay)478 TEST_F(SetPhysicalDisplayPowerModeTest, transitionsDisplayFromDozeSuspendToDozeExternalDisplay) {
479 transitionDisplayCommon<ExternalDisplayPowerCase<TransitionDozeSuspendToDozeVariant>>();
480 }
481
TEST_F(SetPhysicalDisplayPowerModeTest,transitionsDisplayFromDozeToOnExternalDisplay)482 TEST_F(SetPhysicalDisplayPowerModeTest, transitionsDisplayFromDozeToOnExternalDisplay) {
483 transitionDisplayCommon<ExternalDisplayPowerCase<TransitionDozeToOnVariant>>();
484 }
485
TEST_F(SetPhysicalDisplayPowerModeTest,transitionsDisplayFromDozeSuspendToOnExternalDisplay)486 TEST_F(SetPhysicalDisplayPowerModeTest, transitionsDisplayFromDozeSuspendToOnExternalDisplay) {
487 transitionDisplayCommon<ExternalDisplayPowerCase<TransitionDozeSuspendToOnVariant>>();
488 }
489
TEST_F(SetPhysicalDisplayPowerModeTest,transitionsDisplayFromOnToDozeSuspendExternalDisplay)490 TEST_F(SetPhysicalDisplayPowerModeTest, transitionsDisplayFromOnToDozeSuspendExternalDisplay) {
491 transitionDisplayCommon<ExternalDisplayPowerCase<TransitionOnToDozeSuspendVariant>>();
492 }
493
TEST_F(SetPhysicalDisplayPowerModeTest,transitionsDisplayFromOnToUnknownExternalDisplay)494 TEST_F(SetPhysicalDisplayPowerModeTest, transitionsDisplayFromOnToUnknownExternalDisplay) {
495 transitionDisplayCommon<ExternalDisplayPowerCase<TransitionOnToUnknownVariant>>();
496 }
497
498 } // namespace
499 } // namespace android
500