| Index: services/ui/ws/user_display_manager_unittest.cc
|
| diff --git a/services/ui/ws/user_display_manager_unittest.cc b/services/ui/ws/user_display_manager_unittest.cc
|
| index 957d1a4aa3adc94a56d19b4aa3ad5ae246f61166..cbff4583e61254412789211cece44bdfd6afa646 100644
|
| --- a/services/ui/ws/user_display_manager_unittest.cc
|
| +++ b/services/ui/ws/user_display_manager_unittest.cc
|
| @@ -12,6 +12,7 @@
|
| #include "base/strings/string_number_conversions.h"
|
| #include "services/ui/common/types.h"
|
| #include "services/ui/common/util.h"
|
| +#include "services/ui/display/platform_screen.h"
|
| #include "services/ui/public/interfaces/window_tree.mojom.h"
|
| #include "services/ui/surfaces/display_compositor.h"
|
| #include "services/ui/ws/display_manager.h"
|
| @@ -35,6 +36,23 @@ namespace ws {
|
| namespace test {
|
| namespace {
|
|
|
| +// Stub PlatformScreen implementation so PlatformScreen::GetInstance() doesn't
|
| +// fail.
|
| +class TestPlatformScreen : public display::PlatformScreen {
|
| + public:
|
| + TestPlatformScreen() {}
|
| + ~TestPlatformScreen() override {}
|
| +
|
| + // display::PlatformScreen:
|
| + void AddInterfaces(service_manager::InterfaceRegistry* registry) override {}
|
| + void Init(display::PlatformScreenDelegate* delegate) override {}
|
| + void RequestCloseDisplay(int64_t display_id) override {}
|
| + int64_t GetPrimaryDisplayId() const override { return 1; }
|
| +
|
| + private:
|
| + DISALLOW_COPY_AND_ASSIGN(TestPlatformScreen);
|
| +};
|
| +
|
| class TestDisplayManagerObserver : public mojom::DisplayManagerObserver {
|
| public:
|
| TestDisplayManagerObserver() {}
|
| @@ -65,7 +83,9 @@ class TestDisplayManagerObserver : public mojom::DisplayManagerObserver {
|
| }
|
|
|
| // mojom::DisplayManagerObserver:
|
| - void OnDisplays(mojo::Array<mojom::WsDisplayPtr> displays) override {
|
| + void OnDisplays(mojo::Array<mojom::WsDisplayPtr> displays,
|
| + int64_t primary_display_id,
|
| + int64_t internal_display_id) override {
|
| AddCall("OnDisplays " + DisplayIdsToString(displays));
|
| }
|
| void OnDisplaysChanged(mojo::Array<mojom::WsDisplayPtr> displays) override {
|
| @@ -74,6 +94,9 @@ class TestDisplayManagerObserver : public mojom::DisplayManagerObserver {
|
| void OnDisplayRemoved(int64_t id) override {
|
| AddCall("OnDisplayRemoved " + base::Int64ToString(id));
|
| }
|
| + void OnPrimaryDisplayChanged(int64_t id) override {
|
| + AddCall("OnPrimaryDisplayChanged " + base::Int64ToString(id));
|
| + }
|
|
|
| std::string observer_calls_;
|
|
|
| @@ -99,6 +122,7 @@ class UserDisplayManagerTest : public testing::Test {
|
| }
|
|
|
| private:
|
| + TestPlatformScreen platform_screen_;
|
| WindowServerTestHelper ws_test_helper_;
|
| DISALLOW_COPY_AND_ASSIGN(UserDisplayManagerTest);
|
| };
|
|
|