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: components/mus/ws/window_tree_unittest.cc

Issue 1775133003: Moves EventDispatcher from Display to WindowManagerState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: todo 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/ws/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/ws/window_tree_unittest.cc
diff --git a/components/mus/ws/window_tree_unittest.cc b/components/mus/ws/window_tree_unittest.cc
index 17f59eb267b7de38db71e0fb7f501580d20cf0ca..a965dd05a1cbaba85485750dee314aee2ca169a0 100644
--- a/components/mus/ws/window_tree_unittest.cc
+++ b/components/mus/ws/window_tree_unittest.cc
@@ -154,6 +154,10 @@ ClientWindowId FirstRootId(WindowTree* tree) {
: ClientWindowId();
}
+ServerWindow* GetCaptureWindow(Display* display) {
+ return display->GetActiveWindowManagerState()->capture_window();
+}
+
} // namespace
// -----------------------------------------------------------------------------
@@ -196,7 +200,7 @@ class WindowTreeTest : public testing::Test {
}
void AckPreviousEvent() {
- DisplayTestApi test_api(display_);
+ WindowManagerStateTestApi test_api(display_->GetActiveWindowManagerState());
while (test_api.tree_awaiting_input_ack())
test_api.tree_awaiting_input_ack()->OnWindowInputEventAck(0);
}
@@ -635,28 +639,28 @@ TEST_F(WindowTreeTest, ExplicitSetCapture) {
uint32_t change_id = 42;
mojom_window_tree->SetCapture(change_id, WindowIdToTransportId(window->id()));
Display* display = tree->GetDisplay(window);
- EXPECT_NE(window, display->GetCaptureWindow());
+ EXPECT_NE(window, GetCaptureWindow(display));
// Setting capture after the event is acknowledged should fail
DispatchEventAndAckImmediately(CreatePointerDownEvent(10, 10));
mojom_window_tree->SetCapture(++change_id,
WindowIdToTransportId(window->id()));
- EXPECT_NE(window, display->GetCaptureWindow());
+ EXPECT_NE(window, GetCaptureWindow(display));
// Settings while the event is being process should pass
DispatchEventWithoutAck(CreatePointerDownEvent(10, 10));
mojom_window_tree->SetCapture(++change_id,
WindowIdToTransportId(window->id()));
- EXPECT_EQ(window, display->GetCaptureWindow());
+ EXPECT_EQ(window, GetCaptureWindow(display));
AckPreviousEvent();
// Only the capture window should be able to release capture
mojom_window_tree->ReleaseCapture(++change_id,
WindowIdToTransportId(root_window->id()));
- EXPECT_EQ(window, display->GetCaptureWindow());
+ EXPECT_EQ(window, GetCaptureWindow(display));
mojom_window_tree->ReleaseCapture(++change_id,
WindowIdToTransportId(window->id()));
- EXPECT_EQ(nullptr, display->GetCaptureWindow());
+ EXPECT_EQ(nullptr, GetCaptureWindow(display));
}
} // namespace test
« no previous file with comments | « components/mus/ws/window_tree.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698