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

Side by Side Diff: components/mus/ws/window_tree_unittest.cc

Issue 2068093002: mus: Allow embedder to intercept events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tot-merge Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/mus/ws/window_tree.h" 5 #include "components/mus/ws/window_tree.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 ServerWindow* embed_window = wm_tree()->GetWindowByClientId(embed_window_id); 195 ServerWindow* embed_window = wm_tree()->GetWindowByClientId(embed_window_id);
196 ASSERT_TRUE(embed_window); 196 ASSERT_TRUE(embed_window);
197 EXPECT_TRUE(wm_tree()->SetWindowVisibility(embed_window_id, true)); 197 EXPECT_TRUE(wm_tree()->SetWindowVisibility(embed_window_id, true));
198 ASSERT_TRUE(FirstRoot(wm_tree())); 198 ASSERT_TRUE(FirstRoot(wm_tree()));
199 const ClientWindowId wm_root_id = FirstRootId(wm_tree()); 199 const ClientWindowId wm_root_id = FirstRootId(wm_tree());
200 EXPECT_TRUE(wm_tree()->AddWindow(wm_root_id, embed_window_id)); 200 EXPECT_TRUE(wm_tree()->AddWindow(wm_root_id, embed_window_id));
201 display()->root_window()->SetBounds(gfx::Rect(0, 0, 100, 100)); 201 display()->root_window()->SetBounds(gfx::Rect(0, 0, 100, 100));
202 mojom::WindowTreeClientPtr client; 202 mojom::WindowTreeClientPtr client;
203 mojom::WindowTreeClientRequest client_request = GetProxy(&client); 203 mojom::WindowTreeClientRequest client_request = GetProxy(&client);
204 wm_client()->Bind(std::move(client_request)); 204 wm_client()->Bind(std::move(client_request));
205 wm_tree()->Embed(embed_window_id, std::move(client)); 205 const uint32_t embed_flags = 0;
206 wm_tree()->Embed(embed_window_id, std::move(client), embed_flags);
206 WindowTree* tree1 = window_server()->GetTreeWithRoot(embed_window); 207 WindowTree* tree1 = window_server()->GetTreeWithRoot(embed_window);
207 ASSERT_TRUE(tree1 != nullptr); 208 ASSERT_TRUE(tree1 != nullptr);
208 ASSERT_NE(tree1, wm_tree()); 209 ASSERT_NE(tree1, wm_tree());
209 210
210 embed_window->SetBounds(gfx::Rect(0, 0, 50, 50)); 211 embed_window->SetBounds(gfx::Rect(0, 0, 50, 50));
211 212
212 const ClientWindowId child1_id(BuildClientWindowId(tree1, 1)); 213 const ClientWindowId child1_id(BuildClientWindowId(tree1, 1));
213 EXPECT_TRUE(tree1->NewWindow(child1_id, ServerWindow::Properties())); 214 EXPECT_TRUE(tree1->NewWindow(child1_id, ServerWindow::Properties()));
214 EXPECT_TRUE(tree1->AddWindow(ClientWindowIdForWindow(tree1, embed_window), 215 EXPECT_TRUE(tree1->AddWindow(ClientWindowIdForWindow(tree1, embed_window),
215 child1_id)); 216 child1_id));
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after
1007 // Set capture from the embedded client and make sure it gets the event. 1008 // Set capture from the embedded client and make sure it gets the event.
1008 ASSERT_TRUE( 1009 ASSERT_TRUE(
1009 embed_tree->SetCapture(ClientWindowIdForWindow(embed_tree, window))); 1010 embed_tree->SetCapture(ClientWindowIdForWindow(embed_tree, window)));
1010 DispatchEventWithoutAck(CreateMouseMoveEvent(22, 23)); 1011 DispatchEventWithoutAck(CreateMouseMoveEvent(22, 23));
1011 EXPECT_EQ(embed_tree, wm_state_test_api.tree_awaiting_input_ack()); 1012 EXPECT_EQ(embed_tree, wm_state_test_api.tree_awaiting_input_ack());
1012 } 1013 }
1013 1014
1014 } // namespace test 1015 } // namespace test
1015 } // namespace ws 1016 } // namespace ws
1016 } // namespace mus 1017 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/ws/window_tree_client_unittest.cc ('k') | content/browser/renderer_host/render_widget_host_view_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698