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

Unified Diff: services/ui/public/cpp/tests/window_tree_client_unittest.cc

Issue 2447303002: Scale client area, hit test mask and bounds by device_scale_factor. (Closed)
Patch Set: rebase Created 4 years, 1 month 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
Index: services/ui/public/cpp/tests/window_tree_client_unittest.cc
diff --git a/services/ui/public/cpp/tests/window_tree_client_unittest.cc b/services/ui/public/cpp/tests/window_tree_client_unittest.cc
index f20f2d57a8efce13d85110f9f7f16672ec05b389..855ad7f1d3548fb016a743be17a45e42a9c6b1ea 100644
--- a/services/ui/public/cpp/tests/window_tree_client_unittest.cc
+++ b/services/ui/public/cpp/tests/window_tree_client_unittest.cc
@@ -23,6 +23,7 @@
#include "services/ui/public/cpp/window_tree_client_delegate.h"
#include "services/ui/public/cpp/window_tree_client_observer.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/display/test/test_screen.h"
#include "ui/events/event.h"
#include "ui/events/event_utils.h"
#include "ui/gfx/geometry/rect.h"
@@ -75,10 +76,13 @@ class TestWindowTreeClientDelegate : public WindowTreeClientDelegate {
class WindowTreeSetup {
public:
WindowTreeSetup() : tree_client_(&window_tree_delegate_, nullptr, nullptr) {
+ display::Screen::SetScreenInstance(&test_screen_);
WindowTreeClientPrivate(&tree_client_).OnEmbed(&window_tree_);
window_tree_.GetAndClearChangeId(nullptr);
}
+ ~WindowTreeSetup() { display::Screen::SetScreenInstance(nullptr); }
+
WindowTreeClient* client() {
return &tree_client_;
}
@@ -103,6 +107,9 @@ class WindowTreeSetup {
TestWindowTreeClientDelegate window_tree_delegate_;
WindowTreeClient tree_client_;
+ // Dummy screen required to be the screen instance.
+ display::test::TestScreen test_screen_;
+
DISALLOW_COPY_AND_ASSIGN(WindowTreeSetup);
};
« no previous file with comments | « services/ui/public/cpp/tests/window_server_test_base.cc ('k') | services/ui/public/cpp/window_tree_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698