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

Side by Side Diff: ash/mus/window_manager_unittest.cc

Issue 2503623002: Support creation of toplevel mus::Windows on separate displays (Closed)
Patch Set: Remove GetPrimary/SecondaryRootWindowController methods. Created 4 years, 1 month 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
« ash/mus/test/wm_test_base.cc ('K') | « ash/mus/test/wm_test_base.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <memory> 5 #include <memory>
6 6
7 #include "ash/mus/test/wm_test_base.h"
7 #include "base/bind.h" 8 #include "base/bind.h"
8 #include "base/macros.h" 9 #include "base/macros.h"
9 #include "services/service_manager/public/cpp/service_test.h" 10 #include "services/service_manager/public/cpp/service_test.h"
10 #include "services/ui/public/cpp/window.h" 11 #include "services/ui/public/cpp/window.h"
11 #include "services/ui/public/cpp/window_tree_client.h" 12 #include "services/ui/public/cpp/window_tree_client.h"
12 #include "services/ui/public/cpp/window_tree_client_delegate.h" 13 #include "services/ui/public/cpp/window_tree_client_delegate.h"
13 #include "services/ui/public/interfaces/window_tree.mojom.h" 14 #include "services/ui/public/interfaces/window_tree.mojom.h"
14 15
15 namespace ash { 16 namespace ash {
16 namespace mus { 17 namespace mus {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 // |child_window|. This blocks until it succeeds. 74 // |child_window|. This blocks until it succeeds.
74 ui::mojom::WindowTreeClientPtr tree_client; 75 ui::mojom::WindowTreeClientPtr tree_client;
75 auto tree_client_request = GetProxy(&tree_client); 76 auto tree_client_request = GetProxy(&tree_client);
76 child_window->Embed(std::move(tree_client), base::Bind(&OnEmbed)); 77 child_window->Embed(std::move(tree_client), base::Bind(&OnEmbed));
77 std::unique_ptr<ui::WindowTreeClient> child_client(new ui::WindowTreeClient( 78 std::unique_ptr<ui::WindowTreeClient> child_client(new ui::WindowTreeClient(
78 &window_tree_delegate, nullptr, std::move(tree_client_request))); 79 &window_tree_delegate, nullptr, std::move(tree_client_request)));
79 child_client->WaitForEmbed(); 80 child_client->WaitForEmbed();
80 ASSERT_TRUE(!child_client->GetRoots().empty()); 81 ASSERT_TRUE(!child_client->GetRoots().empty());
81 } 82 }
82 83
84 using WindowManagerAshTest = mus::WmTestBase;
mfomitchev 2016/11/18 21:23:40 WindowManagerDisplayTest?
thanhph 2016/11/21 14:37:53 Thanks! I changed it WindowManagerDualDisplayTest.
85
86 TEST_F(WindowManagerAshTest, isWidgetShownInCorrectDisplay) {
mfomitchev 2016/11/18 21:23:40 Capitalize first letter. Widget -> Window.
thanhph 2016/11/21 14:37:53 Done.
87 if (!SupportsMultipleDisplays())
88 return;
89
90 UpdateDisplay("400x400,400x400");
91 EXPECT_NE(GetPrimaryDisplay().id(), GetSecondaryDisplay().id());
92
93 ui::Window* ui_primary_window =
mfomitchev 2016/11/18 21:23:40 window_primary_display, window_secondary_display.
thanhph 2016/11/21 14:37:53 Done.
94 CreateFullscreenTestWindow(GetPrimaryDisplay().id());
95 ui::Window* ui_secondary_window =
96 CreateFullscreenTestWindow(GetSecondaryDisplay().id());
97
98 DCHECK(ui_primary_window);
99 DCHECK(ui_secondary_window);
100
101 EXPECT_NE(ui_primary_window->display_id(), ui_secondary_window->display_id());
mfomitchev 2016/11/18 21:23:40 A better test would be to actually ensure the two
thanhph 2016/11/21 14:37:53 Done. Thanks!
102 }
103
83 } // namespace mus 104 } // namespace mus
84 } // namespace ash 105 } // namespace ash
OLDNEW
« ash/mus/test/wm_test_base.cc ('K') | « ash/mus/test/wm_test_base.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698