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

Unified Diff: services/ui/ws/window_tree_unittest.cc

Issue 2710023007: Make WindowTree::SetModal() take the type. (Closed)
Patch Set: address feedback. Created 3 years, 9 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 | « services/ui/ws/window_tree.cc ('k') | ui/aura/mus/in_flight_change.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/window_tree_unittest.cc
diff --git a/services/ui/ws/window_tree_unittest.cc b/services/ui/ws/window_tree_unittest.cc
index c10a22b9f16c38e6abdd153ad654dc9da48bfa7e..2fef45ed1fed5241c241d3bfa1509d1d5e305203 100644
--- a/services/ui/ws/window_tree_unittest.cc
+++ b/services/ui/ws/window_tree_unittest.cc
@@ -802,7 +802,7 @@ TEST_F(WindowTreeTest, ShowModalWindowWithDescendantCapture) {
w2->SetBounds(gfx::Rect(50, 10, 10, 10));
ASSERT_TRUE(tree->AddWindow(root_window_id, w2_id));
ASSERT_TRUE(tree->AddTransientWindow(w1_id, w2_id));
- ASSERT_TRUE(tree->SetModal(w2_id));
+ ASSERT_TRUE(tree->SetModalType(w2_id, MODAL_TYPE_WINDOW));
// Set capture to |w11|.
DispatchEventWithoutAck(CreatePointerDownEvent(25, 25));
@@ -855,7 +855,7 @@ TEST_F(WindowTreeTest, VisibleWindowToModalWithDescendantCapture) {
// Set |w2| modal to |w1|. This should release the capture as the capture is
// set to a descendant of the modal parent.
ASSERT_TRUE(tree->AddTransientWindow(w1_id, w2_id));
- ASSERT_TRUE(tree->SetModal(w2_id));
+ ASSERT_TRUE(tree->SetModalType(w2_id, MODAL_TYPE_WINDOW));
EXPECT_EQ(nullptr, GetCaptureWindow(display));
}
@@ -874,14 +874,14 @@ TEST_F(WindowTreeTest, ShowModalWindowWithNonDescendantCapture) {
Display* display = tree->GetDisplay(w1);
// Create |w2| as a child of |root_window| and modal to |w1| and leave it
- // hidden..
+ // hidden.
ClientWindowId w2_id = BuildClientWindowId(tree, 2);
ASSERT_TRUE(tree->NewWindow(w2_id, ServerWindow::Properties()));
ServerWindow* w2 = tree->GetWindowByClientId(w2_id);
w2->SetBounds(gfx::Rect(50, 10, 10, 10));
ASSERT_TRUE(tree->AddWindow(root_window_id, w2_id));
ASSERT_TRUE(tree->AddTransientWindow(w1_id, w2_id));
- ASSERT_TRUE(tree->SetModal(w2_id));
+ ASSERT_TRUE(tree->SetModalType(w2_id, MODAL_TYPE_WINDOW));
// Create |w3| as a child of |root_window| and make it visible.
ClientWindowId w3_id = BuildClientWindowId(tree, 3);
@@ -941,7 +941,7 @@ TEST_F(WindowTreeTest, VisibleWindowToModalWithNonDescendantCapture) {
// Set |w2| modal to |w1|. This should not release the capture as the capture
// is not set to a descendant of the modal parent.
ASSERT_TRUE(tree->AddTransientWindow(w1_id, w2_id));
- ASSERT_TRUE(tree->SetModal(w2_id));
+ ASSERT_TRUE(tree->SetModalType(w2_id, MODAL_TYPE_WINDOW));
EXPECT_EQ(w3, GetCaptureWindow(display));
}
@@ -965,7 +965,7 @@ TEST_F(WindowTreeTest, ShowSystemModalWindowWithCapture) {
ServerWindow* w2 = tree->GetWindowByClientId(w2_id);
w2->SetBounds(gfx::Rect(30, 10, 10, 10));
ASSERT_TRUE(tree->AddWindow(root_window_id, w2_id));
- ASSERT_TRUE(tree->SetModal(w2_id));
+ ASSERT_TRUE(tree->SetModalType(w2_id, MODAL_TYPE_SYSTEM));
// Set capture to |w1|.
DispatchEventWithoutAck(CreatePointerDownEvent(15, 15));
@@ -1007,7 +1007,7 @@ TEST_F(WindowTreeTest, VisibleWindowToSystemModalWithCapture) {
AckPreviousEvent();
// Make |w2| modal to system. This should release capture.
- ASSERT_TRUE(tree->SetModal(w2_id));
+ ASSERT_TRUE(tree->SetModalType(w2_id, MODAL_TYPE_SYSTEM));
EXPECT_EQ(nullptr, GetCaptureWindow(display));
}
@@ -1042,7 +1042,7 @@ TEST_F(WindowTreeTest, MoveCaptureWindowToModalParent) {
// Set |w2| modal to |w1|.
ASSERT_TRUE(tree->AddTransientWindow(w1_id, w2_id));
- ASSERT_TRUE(tree->SetModal(w2_id));
+ ASSERT_TRUE(tree->SetModalType(w2_id, MODAL_TYPE_WINDOW));
// Set capture to |w3|.
DispatchEventWithoutAck(CreatePointerDownEvent(25, 25));
« no previous file with comments | « services/ui/ws/window_tree.cc ('k') | ui/aura/mus/in_flight_change.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698