Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Unified Diff: services/ui/test_wm/test_wm.cc

Issue 2535983004: Makes sure bounds and visibilty are updated correctly for new displays (Closed)
Patch Set: merge Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/ui/test_wm/BUILD.gn ('k') | ui/aura/mus/window_tree_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/test_wm/test_wm.cc
diff --git a/services/ui/test_wm/test_wm.cc b/services/ui/test_wm/test_wm.cc
index 37b19dd1590e23dd94db7b13212e63e2c8a124d1..ed0d1e795a341942395fc660445146da06a06de0 100644
--- a/services/ui/test_wm/test_wm.cc
+++ b/services/ui/test_wm/test_wm.cc
@@ -25,7 +25,8 @@
#include "ui/aura/test/test_focus_client.h"
#include "ui/aura/window.h"
#include "ui/display/display.h"
-#include "ui/display/test/test_screen.h"
+#include "ui/display/display_list.h"
+#include "ui/display/screen_base.h"
#include "ui/wm/core/capture_controller.h"
#include "ui/wm/core/wm_state.h"
@@ -55,8 +56,8 @@ class TestWM : public service_manager::Service,
void OnStart() override {
CHECK(!started_);
started_ = true;
- test_screen_ = base::MakeUnique<display::test::TestScreen>();
- display::Screen::SetScreenInstance(test_screen_.get());
+ screen_ = base::MakeUnique<display::ScreenBase>();
+ display::Screen::SetScreenInstance(screen_.get());
aura_env_ = aura::Env::CreateInstance(aura::Env::Mode::MUS);
gpu_service_ = ui::GpuService::Create(context()->connector(), nullptr);
compositor_context_factory_ =
@@ -127,7 +128,12 @@ class TestWM : public service_manager::Service,
bool janky) override {
// Don't care.
}
- void OnWmWillCreateDisplay(const display::Display& display) override {}
+ void OnWmWillCreateDisplay(const display::Display& display) override {
+ // This class only deals with one display.
+ DCHECK_EQ(0u, screen_->display_list().displays().size());
+ screen_->display_list().AddDisplay(display,
+ display::DisplayList::Type::PRIMARY);
+ }
void OnWmNewDisplay(std::unique_ptr<aura::WindowTreeHostMus> window_tree_host,
const display::Display& display) override {
// Only handles a single root.
@@ -161,8 +167,7 @@ class TestWM : public service_manager::Service,
const gfx::Insets& insets,
const std::vector<gfx::Rect>& additional_client_areas) override {}
- // Dummy screen required to be the screen instance.
- std::unique_ptr<display::test::TestScreen> test_screen_;
+ std::unique_ptr<display::ScreenBase> screen_;
std::unique_ptr<aura::Env> aura_env_;
::wm::WMState wm_state_;
« no previous file with comments | « services/ui/test_wm/BUILD.gn ('k') | ui/aura/mus/window_tree_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698