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

Unified Diff: ui/aura/mus/window_tree_client_unittest.cc

Issue 2454973003: Wires up modality for aura-mus (Closed)
Patch Set: cleanup Created 4 years, 2 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
Index: ui/aura/mus/window_tree_client_unittest.cc
diff --git a/ui/aura/mus/window_tree_client_unittest.cc b/ui/aura/mus/window_tree_client_unittest.cc
index f186bd6f14708534cf2db8111b7bfc0f8f880cd5..2dd9326ae73cc7e9473a7e4ff37581889e5793a3 100644
--- a/ui/aura/mus/window_tree_client_unittest.cc
+++ b/ui/aura/mus/window_tree_client_unittest.cc
@@ -1048,4 +1048,19 @@ TEST_F(WindowTreeClientWmTest, OnWindowTreeCaptureChanged) {
capture_recorder.reset_capture_captured_count();
}
+TEST_F(WindowTreeClientClientTest, Modal) {
msw 2016/10/27 18:37:37 nit: test a successful change, sequential changes,
sky 2016/10/27 19:30:06 I added a successful test. Sequential doesn't real
+ Window window(nullptr);
+ window.Init(ui::LAYER_NOT_DRAWN);
+ window.SetProperty(client::kModalKey, ui::MODAL_TYPE_WINDOW);
+ // Make sure server was told about it, and have the server say it failed.
+ ASSERT_TRUE(
+ window_tree()->AckSingleChangeOfType(WindowTreeChangeType::MODAL, false));
+ // Type should be back to MODAL_TYPE_NONE as the server didn't accept the
+ // change.
+ EXPECT_EQ(ui::MODAL_TYPE_NONE, window.GetProperty(client::kModalKey));
+ // There should be no more modal changes.
+ EXPECT_FALSE(
+ window_tree()->AckSingleChangeOfType(WindowTreeChangeType::MODAL, false));
+}
+
} // namespace aura

Powered by Google App Engine
This is Rietveld 408576698