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 <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 class MusWindowManagerTest : public service_manager::test::ServiceTest { |
|
msw
2017/03/07 21:36:01
optional nit: rename file mus_window_manager_unitt
sky
2017/03/07 21:43:30
I would rather keep the file name matching the nam
| |
| 66 public: | 66 public: |
| 67 WindowManagerTest() : service_manager::test::ServiceTest("mash_unittests") {} | 67 MusWindowManagerTest() |
| 68 ~WindowManagerTest() override {} | 68 : service_manager::test::ServiceTest("mash_unittests") {} |
| 69 ~MusWindowManagerTest() override {} | |
| 69 | 70 |
| 70 private: | 71 private: |
| 71 DISALLOW_COPY_AND_ASSIGN(WindowManagerTest); | 72 DISALLOW_COPY_AND_ASSIGN(MusWindowManagerTest); |
| 72 }; | 73 }; |
| 73 | 74 |
| 74 void OnEmbed(bool success) { | 75 void OnEmbed(bool success) { |
| 75 ASSERT_TRUE(success); | 76 ASSERT_TRUE(success); |
| 76 } | 77 } |
| 77 | 78 |
| 78 TEST_F(WindowManagerTest, OpenWindow) { | 79 TEST_F(MusWindowManagerTest, OpenWindow) { |
| 79 display::ScreenBase screen; | 80 display::ScreenBase screen; |
| 80 screen.display_list().AddDisplay( | 81 screen.display_list().AddDisplay( |
| 81 display::Display(1, gfx::Rect(0, 0, 200, 200)), | 82 display::Display(1, gfx::Rect(0, 0, 200, 200)), |
| 82 display::DisplayList::Type::PRIMARY); | 83 display::DisplayList::Type::PRIMARY); |
| 83 display::Screen::SetScreenInstance(&screen); | 84 display::Screen::SetScreenInstance(&screen); |
| 84 | 85 |
| 85 WindowTreeClientDelegate window_tree_delegate; | 86 WindowTreeClientDelegate window_tree_delegate; |
| 86 | 87 |
| 87 connector()->Connect(mojom::kServiceName); | 88 connector()->Connect(mojom::kServiceName); |
| 88 | 89 |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 108 client.Embed(child_window, std::move(tree_client), 0u, base::Bind(&OnEmbed)); | 109 client.Embed(child_window, std::move(tree_client), 0u, base::Bind(&OnEmbed)); |
| 109 aura::WindowTreeClient child_client(connector(), &window_tree_delegate, | 110 aura::WindowTreeClient child_client(connector(), &window_tree_delegate, |
| 110 nullptr, std::move(tree_client_request)); | 111 nullptr, std::move(tree_client_request)); |
| 111 window_tree_delegate.WaitForEmbed(); | 112 window_tree_delegate.WaitForEmbed(); |
| 112 ASSERT_TRUE(!child_client.GetRoots().empty()); | 113 ASSERT_TRUE(!child_client.GetRoots().empty()); |
| 113 window_tree_delegate.DestroyWindowTreeHost(); | 114 window_tree_delegate.DestroyWindowTreeHost(); |
| 114 } | 115 } |
| 115 | 116 |
| 116 } // namespace mus | 117 } // namespace mus |
| 117 } // namespace ash | 118 } // namespace ash |
| OLD | NEW |