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

Unified Diff: components/mus/ws/display_unittest.cc

Issue 1868783003: Makes SetFocus() notify callback correctly on failure (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/display.cc ('k') | components/mus/ws/focus_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/display_unittest.cc
diff --git a/components/mus/ws/display_unittest.cc b/components/mus/ws/display_unittest.cc
index 5d54baa0a483a52b572f33541d87cd89255941ac..ca573c982be8d741b8db69d9c5c2b36ebb97c82e 100644
--- a/components/mus/ws/display_unittest.cc
+++ b/components/mus/ws/display_unittest.cc
@@ -259,20 +259,26 @@ TEST_F(DisplayTest, FocusFailsForInactiveUser) {
Display* display = *display_manager->displays().begin();
WindowManagerState* wms_for_id2 =
display->GetWindowManagerStateForUser(kTestId2);
+ wms_for_id2->tree()->AddActivationParent(
+ ClientWindowIdForFirstRoot(wms_for_id2->tree()));
ASSERT_TRUE(wms_for_id2);
EXPECT_FALSE(wms_for_id2->IsActive());
+ ClientWindowId child2_id;
+ NewWindowInTree(wms_for_id2->tree(), &child2_id);
// Focus should fail for windows in inactive window managers.
- EXPECT_FALSE(wms_for_id2->tree()->SetFocus(
- ClientWindowIdForFirstRoot(wms_for_id2->tree())));
+ EXPECT_FALSE(wms_for_id2->tree()->SetFocus(child2_id));
// Focus should succeed for the active window manager.
WindowManagerState* wms_for_id1 =
display->GetWindowManagerStateForUser(kTestId1);
ASSERT_TRUE(wms_for_id1);
+ wms_for_id1->tree()->AddActivationParent(
+ ClientWindowIdForFirstRoot(wms_for_id1->tree()));
+ ClientWindowId child1_id;
+ NewWindowInTree(wms_for_id1->tree(), &child1_id);
EXPECT_TRUE(wms_for_id1->IsActive());
- EXPECT_TRUE(wms_for_id1->tree()->SetFocus(
- ClientWindowIdForFirstRoot(wms_for_id1->tree())));
+ EXPECT_TRUE(wms_for_id1->tree()->SetFocus(child1_id));
}
// Verifies clients are notified of focus changes in different displays.
« no previous file with comments | « components/mus/ws/display.cc ('k') | components/mus/ws/focus_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698