|
17 | 17 | #undef LOG_TAG |
18 | 18 | #define LOG_TAG "LibSurfaceFlingerUnittests" |
19 | 19 |
|
| 20 | +#include <aidl/android/hardware/graphics/common/DisplayHotplugEvent.h> |
| 21 | +#include <com_android_graphics_surfaceflinger_flags.h> |
| 22 | +#include <common/test/FlagUtils.h> |
20 | 23 | #include "DisplayTransactionTestHelpers.h" |
21 | 24 |
|
| 25 | +using namespace com::android::graphics::surfaceflinger; |
| 26 | +using ::aidl::android::hardware::graphics::common::DisplayHotplugEvent; |
| 27 | + |
22 | 28 | namespace android { |
23 | 29 |
|
24 | 30 | class HotplugTest : public DisplayTransactionTest {}; |
@@ -87,13 +93,19 @@ TEST_F(HotplugTest, ignoresDuplicateDisconnection) { |
87 | 93 | } |
88 | 94 |
|
89 | 95 | TEST_F(HotplugTest, rejectsHotplugIfFailedToLoadDisplayModes) { |
| 96 | + SET_FLAG_FOR_TEST(flags::connected_display, true); |
| 97 | + |
90 | 98 | // Inject a primary display. |
91 | 99 | PrimaryDisplayVariant::injectHwcDisplay(this); |
92 | 100 |
|
93 | 101 | using ExternalDisplay = ExternalDisplayVariant; |
94 | 102 | constexpr bool kFailedHotplug = true; |
95 | 103 | ExternalDisplay::setupHwcHotplugCallExpectations<kFailedHotplug>(this); |
96 | 104 |
|
| 105 | + EXPECT_CALL(*mEventThread, |
| 106 | + onHotplugConnectionError(static_cast<int32_t>(DisplayHotplugEvent::ERROR_UNKNOWN))) |
| 107 | + .Times(1); |
| 108 | + |
97 | 109 | // Simulate a connect event that fails to load display modes due to HWC already having |
98 | 110 | // disconnected the display but SF yet having to process the queued disconnect event. |
99 | 111 | EXPECT_CALL(*mComposer, getActiveConfig(ExternalDisplay::HWC_DISPLAY_ID, _)) |
|
0 commit comments