Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 DisplayWindowInSpecifiedDisplayTest = mus::WmTestBase; | |
|
mfomitchev
2016/11/23 17:58:00
I think this is still too specific. This name corr
thanhph
2016/11/23 18:42:19
I misinterpreted your last comment. Done, thanks!
| |
| 85 | |
| 86 TEST_F(DisplayWindowInSpecifiedDisplayTest, IsWindowShownInCorrectDisplay) { | |
| 87 if (!SupportsMultipleDisplays()) | |
| 88 return; | |
| 89 | |
| 90 UpdateDisplay("400x400,400x400"); | |
| 91 EXPECT_NE(GetPrimaryDisplay().id(), GetSecondaryDisplay().id()); | |
| 92 | |
| 93 ui::Window* window_primary_display = | |
| 94 CreateFullscreenTestWindow(GetPrimaryDisplay().id()); | |
| 95 ui::Window* window_secondary_display = | |
| 96 CreateFullscreenTestWindow(GetSecondaryDisplay().id()); | |
| 97 | |
| 98 DCHECK(window_primary_display); | |
| 99 DCHECK(window_secondary_display); | |
| 100 | |
| 101 EXPECT_EQ(window_primary_display->display_id(), GetPrimaryDisplay().id()); | |
| 102 EXPECT_EQ(window_secondary_display->display_id(), GetSecondaryDisplay().id()); | |
| 103 } | |
| 104 | |
| 83 } // namespace mus | 105 } // namespace mus |
| 84 } // namespace ash | 106 } // namespace ash |
| OLD | NEW |