| 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 <map> | 5 #include <map> |
| 6 #include <memory> | 6 #include <memory> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/public/interfaces/constants.mojom.h" | 9 #include "ash/public/interfaces/constants.mojom.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 } | 55 } |
| 56 | 56 |
| 57 base::RunLoop run_loop_; | 57 base::RunLoop run_loop_; |
| 58 wm::WMState wm_state_; | 58 wm::WMState wm_state_; |
| 59 aura::PropertyConverter property_converter_; | 59 aura::PropertyConverter property_converter_; |
| 60 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host_; | 60 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host_; |
| 61 | 61 |
| 62 DISALLOW_COPY_AND_ASSIGN(WindowTreeClientDelegate); | 62 DISALLOW_COPY_AND_ASSIGN(WindowTreeClientDelegate); |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 class WindowManagerTest : public service_manager::test::ServiceTest { | 65 // NOTE: this isn't named WindowManagerTest because gtest complains about tests |
| 66 // with the same name (there is already a WindowManagerTest in ash). |
| 67 class MusWindowManagerTest : public service_manager::test::ServiceTest { |
| 66 public: | 68 public: |
| 67 WindowManagerTest() : service_manager::test::ServiceTest("mash_unittests") {} | 69 MusWindowManagerTest() |
| 68 ~WindowManagerTest() override {} | 70 : service_manager::test::ServiceTest("mash_unittests") {} |
| 71 ~MusWindowManagerTest() override {} |
| 69 | 72 |
| 70 private: | 73 private: |
| 71 DISALLOW_COPY_AND_ASSIGN(WindowManagerTest); | 74 DISALLOW_COPY_AND_ASSIGN(MusWindowManagerTest); |
| 72 }; | 75 }; |
| 73 | 76 |
| 74 void OnEmbed(bool success) { | 77 void OnEmbed(bool success) { |
| 75 ASSERT_TRUE(success); | 78 ASSERT_TRUE(success); |
| 76 } | 79 } |
| 77 | 80 |
| 78 TEST_F(WindowManagerTest, OpenWindow) { | 81 TEST_F(MusWindowManagerTest, OpenWindow) { |
| 79 display::ScreenBase screen; | 82 display::ScreenBase screen; |
| 80 screen.display_list().AddDisplay( | 83 screen.display_list().AddDisplay( |
| 81 display::Display(1, gfx::Rect(0, 0, 200, 200)), | 84 display::Display(1, gfx::Rect(0, 0, 200, 200)), |
| 82 display::DisplayList::Type::PRIMARY); | 85 display::DisplayList::Type::PRIMARY); |
| 83 display::Screen::SetScreenInstance(&screen); | 86 display::Screen::SetScreenInstance(&screen); |
| 84 | 87 |
| 85 WindowTreeClientDelegate window_tree_delegate; | 88 WindowTreeClientDelegate window_tree_delegate; |
| 86 | 89 |
| 87 connector()->Connect(mojom::kServiceName); | 90 connector()->Connect(mojom::kServiceName); |
| 88 | 91 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 108 client.Embed(child_window, std::move(tree_client), 0u, base::Bind(&OnEmbed)); | 111 client.Embed(child_window, std::move(tree_client), 0u, base::Bind(&OnEmbed)); |
| 109 aura::WindowTreeClient child_client(connector(), &window_tree_delegate, | 112 aura::WindowTreeClient child_client(connector(), &window_tree_delegate, |
| 110 nullptr, std::move(tree_client_request)); | 113 nullptr, std::move(tree_client_request)); |
| 111 window_tree_delegate.WaitForEmbed(); | 114 window_tree_delegate.WaitForEmbed(); |
| 112 ASSERT_TRUE(!child_client.GetRoots().empty()); | 115 ASSERT_TRUE(!child_client.GetRoots().empty()); |
| 113 window_tree_delegate.DestroyWindowTreeHost(); | 116 window_tree_delegate.DestroyWindowTreeHost(); |
| 114 } | 117 } |
| 115 | 118 |
| 116 } // namespace mus | 119 } // namespace mus |
| 117 } // namespace ash | 120 } // namespace ash |
| OLD | NEW |