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

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

Issue 2745143004: Inform window manager about modal windows in mus+ash. (Closed)
Patch Set: rebased. 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_client_unittest.cc ('k') | ui/aura/mus/window_tree_client.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 f44679b47e7fd65bf09795653a884581752f8830..87f4bd0bab9c81bd4b3e9c4b041b66f5a63b4049 100644
--- a/services/ui/ws/window_tree_unittest.cc
+++ b/services/ui/ws/window_tree_unittest.cc
@@ -1394,6 +1394,39 @@ TEST_F(WindowTreeTest, CaptureNotifiesWm) {
ChangesToDescription1(*embed_client->tracker()->changes())[0]);
}
+TEST_F(WindowTreeTest, SetModalTypeForwardedToWindowManager) {
+ TestWindowManager wm_internal;
+ set_window_manager_internal(wm_tree(), &wm_internal);
+
+ TestWindowTreeBinding* child_binding = nullptr;
+ WindowTree* child_tree = CreateNewTree(wm_tree()->user_id(), &child_binding);
+
+ // Create a new top level window.
+ std::unordered_map<std::string, std::vector<uint8_t>> properties;
+ const uint32_t initial_change_id = 17;
+ // Explicitly use an id that does not contain the client id.
+ const ClientWindowId embed_window_id2_in_child(45 << 16 | 27);
+ static_cast<mojom::WindowTree*>(child_tree)
+ ->NewTopLevelWindow(initial_change_id, embed_window_id2_in_child.id,
+ properties);
+
+ // Create the window for |embed_window_id2_in_child|.
+ const ClientWindowId embed_window_id2 = BuildClientWindowId(wm_tree(), 2);
+ EXPECT_TRUE(
+ wm_tree()->NewWindow(embed_window_id2, ServerWindow::Properties()));
+ EXPECT_TRUE(wm_tree()->SetWindowVisibility(embed_window_id2, true));
+ EXPECT_TRUE(wm_tree()->AddWindow(FirstRootId(wm_tree()), embed_window_id2));
+
+ // Ack the change, which should resume the binding.
+ static_cast<mojom::WindowManagerClient*>(wm_tree())
+ ->OnWmCreatedTopLevelWindow(0u, embed_window_id2.id);
+
+ // Change modal type to MODAL_TYPE_SYSTEM and check that it is forwarded to
+ // the window manager.
+ child_tree->SetModalType(embed_window_id2_in_child, MODAL_TYPE_SYSTEM);
+ EXPECT_TRUE(wm_internal.on_set_modal_type_called());
+}
+
using WindowTreeShutdownTest = testing::Test;
// Makes sure WindowTreeClient doesn't get any messages during shutdown.
« no previous file with comments | « services/ui/ws/window_tree_client_unittest.cc ('k') | ui/aura/mus/window_tree_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698