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

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

Issue 2454973003: Wires up modality for aura-mus (Closed)
Patch Set: more tests 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
« no previous file with comments | « ui/aura/mus/window_tree_client.cc ('k') | ui/aura/test/mus/test_window_tree.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e14f5e35718f4aaf212d3e32a9804c66c14fa349 100644
--- a/ui/aura/mus/window_tree_client_unittest.cc
+++ b/ui/aura/mus/window_tree_client_unittest.cc
@@ -1048,4 +1048,32 @@ TEST_F(WindowTreeClientWmTest, OnWindowTreeCaptureChanged) {
capture_recorder.reset_capture_captured_count();
}
+TEST_F(WindowTreeClientClientTest, ModalFail) {
+ 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));
+}
+
+TEST_F(WindowTreeClientClientTest, ModalSuccess) {
+ Window window(nullptr);
+ window.Init(ui::LAYER_NOT_DRAWN);
+ window.SetProperty(client::kModalKey, ui::MODAL_TYPE_WINDOW);
+ // Ack change as succeeding.
+ ASSERT_TRUE(
+ window_tree()->AckSingleChangeOfType(WindowTreeChangeType::MODAL, true));
+ EXPECT_EQ(ui::MODAL_TYPE_WINDOW, window.GetProperty(client::kModalKey));
+ // There should be no more modal changes.
+ EXPECT_FALSE(
+ window_tree()->AckSingleChangeOfType(WindowTreeChangeType::MODAL, false));
+}
+
} // namespace aura
« no previous file with comments | « ui/aura/mus/window_tree_client.cc ('k') | ui/aura/test/mus/test_window_tree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698