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

Unified Diff: ash/drag_drop/drag_drop_tracker_unittest.cc

Issue 2194353002: mash: Migrate ScopedTargetRootWindow to //ash/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: non-virtual Created 4 years, 4 months 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 | « ash/display/screen_position_controller.cc ('k') | ash/mus/bridge/wm_shell_mus.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/drag_drop/drag_drop_tracker_unittest.cc
diff --git a/ash/drag_drop/drag_drop_tracker_unittest.cc b/ash/drag_drop/drag_drop_tracker_unittest.cc
index f41633b75331c8b6acd169fa4354f0b787a51f1b..43c4f522ea5a603278a978d11945449fb6d7ead4 100644
--- a/ash/drag_drop/drag_drop_tracker_unittest.cc
+++ b/ash/drag_drop/drag_drop_tracker_unittest.cc
@@ -6,7 +6,10 @@
#include <memory>
+#include "ash/aura/wm_window_aura.h"
+#include "ash/common/scoped_root_window_for_new_windows.h"
#include "ash/common/shell_window_ids.h"
+#include "ash/common/wm_shell.h"
#include "ash/shell.h"
#include "ash/test/ash_test_base.h"
#include "ui/aura/test/test_windows.h"
@@ -66,8 +69,9 @@ TEST_F(DragDropTrackerTest, GetTarget) {
EXPECT_EQ("0,0 100x100", window0->GetBoundsInScreen().ToString());
EXPECT_EQ("300,100 100x100", window1->GetBoundsInScreen().ToString());
- // Make RootWindow0 active so that capture window is parented to it.
- Shell::GetInstance()->set_target_root_window(root_windows[0]);
+ // RootWindow0 is active so the capture window is parented to it.
+ EXPECT_EQ(WmWindowAura::Get(root_windows[0]),
+ WmShell::Get()->GetRootWindowForNewWindows());
// Start tracking from the RootWindow1 and check the point on RootWindow0 that
// |window0| covers.
@@ -88,7 +92,8 @@ TEST_F(DragDropTrackerTest, GetTarget) {
EXPECT_NE(window1.get(), GetTarget(gfx::Point(50, 250)));
// Make RootWindow1 active so that capture window is parented to it.
- Shell::GetInstance()->set_target_root_window(root_windows[1]);
+ ScopedRootWindowForNewWindows root_for_new_windows(
+ WmWindowAura::Get(root_windows[1]));
// Start tracking from the RootWindow1 and check the point on RootWindow0 that
// |window0| covers.
@@ -125,8 +130,9 @@ TEST_F(DragDropTrackerTest, ConvertEvent) {
CreateTestWindow(gfx::Rect(300, 100, 100, 100)));
window1->Show();
- // Make RootWindow0 active so that capture window is parented to it.
- Shell::GetInstance()->set_target_root_window(root_windows[0]);
+ // RootWindow0 is active so the capture window is parented to it.
+ EXPECT_EQ(WmWindowAura::Get(root_windows[0]),
+ WmShell::Get()->GetRootWindowForNewWindows());
// Start tracking from the RootWindow0 and converts the mouse event into
// |window0|'s coodinates.
@@ -153,7 +159,8 @@ TEST_F(DragDropTrackerTest, ConvertEvent) {
EXPECT_EQ(original01.flags(), converted01->flags());
// Make RootWindow1 active so that capture window is parented to it.
- Shell::GetInstance()->set_target_root_window(root_windows[1]);
+ ScopedRootWindowForNewWindows root_for_new_windows(
+ WmWindowAura::Get(root_windows[1]));
// Start tracking from the RootWindow1 and converts the mouse event into
// |window0|'s coodinates.
« no previous file with comments | « ash/display/screen_position_controller.cc ('k') | ash/mus/bridge/wm_shell_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698