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

Unified Diff: components/mus/public/cpp/tests/window_tree_client_impl_unittest.cc

Issue 1811913004: mus: Allow SetModal to fail gracefully (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed constructor/destructor Created 4 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 | « components/mus/public/cpp/tests/test_window_tree.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/public/cpp/tests/window_tree_client_impl_unittest.cc
diff --git a/components/mus/public/cpp/tests/window_tree_client_impl_unittest.cc b/components/mus/public/cpp/tests/window_tree_client_impl_unittest.cc
index 3e1b707609642909f2835b4e16712825b6e582a2..f15e3da40d3f05a7c12a5456e2bb1e770f3e14e3 100644
--- a/components/mus/public/cpp/tests/window_tree_client_impl_unittest.cc
+++ b/components/mus/public/cpp/tests/window_tree_client_impl_unittest.cc
@@ -338,6 +338,20 @@ TEST_F(WindowTreeClientImplTest, SetVisibleFailedWithPendingChange) {
EXPECT_EQ(original_visible, root->visible());
}
+// Verifies |is_modal| is reverted if the server replied that the change failed.
+TEST_F(WindowTreeClientImplTest, SetModalFailed) {
+ WindowTreeSetup setup;
+ Window* root = setup.GetFirstRoot();
+ ASSERT_TRUE(root);
+ EXPECT_FALSE(root->is_modal());
+ root->SetModal();
+ uint32_t change_id;
+ ASSERT_TRUE(setup.window_tree()->GetAndClearChangeId(&change_id));
+ EXPECT_TRUE(root->is_modal());
+ setup.window_tree_client()->OnChangeCompleted(change_id, false);
+ EXPECT_FALSE(root->is_modal());
+}
+
TEST_F(WindowTreeClientImplTest, InputEventBasic) {
WindowTreeSetup setup;
Window* root = setup.GetFirstRoot();
« no previous file with comments | « components/mus/public/cpp/tests/test_window_tree.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698