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

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

Issue 2503623002: Support creation of toplevel mus::Windows on separate displays (Closed)
Patch Set: Add blank line back. Remove duplicate function. 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;
85
86 TEST_F(WindowManagerAshTest, isWidgetShownInCorrectDisplay) {
87 if (!SupportsMultipleDisplays())
88 return;
89
90 UpdateDisplay("400x400,400x400");
91 EXPECT_NE(GetPrimaryRootWindowController(),
92 GetSecondaryRootWindowController());
93
94 ui::Window* ui_primary_window =
95 CreateFullscreenTestWindow(GetPrimaryRootWindowController());
96 ui::Window* ui_secondary_window =
97 CreateFullscreenTestWindow(GetSecondaryRootWindowController());
98
99 DCHECK(ui_primary_window);
100 DCHECK(ui_secondary_window);
101
102 EXPECT_NE(ui_primary_window->display_id(), ui_secondary_window->display_id());
103 }
104
83 } // namespace mus 105 } // namespace mus
84 } // namespace ash 106 } // 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