OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ash/mus/test/ash_test_impl_mus.h" | 5 #include "ash/mus/test/ash_test_impl_mus.h" |
6 | 6 |
7 #include "ash/test/ash_test.h" | 7 #include "ash/test/ash_test.h" |
8 #include "ash/wm_window.h" | 8 #include "ash/wm_window.h" |
9 #include "base/command_line.h" | |
10 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
11 #include "services/ui/public/cpp/property_type_converters.h" | 10 #include "services/ui/public/cpp/property_type_converters.h" |
12 #include "services/ui/public/interfaces/window_manager.mojom.h" | 11 #include "services/ui/public/interfaces/window_manager.mojom.h" |
13 #include "ui/aura/window.h" | 12 #include "ui/aura/window.h" |
14 #include "ui/display/display_switches.h" | |
15 #include "ui/wm/core/window_util.h" | 13 #include "ui/wm/core/window_util.h" |
16 | 14 |
17 namespace ash { | 15 namespace ash { |
18 namespace mus { | 16 namespace mus { |
19 namespace { | 17 namespace { |
20 | 18 |
21 // WmTestBase is abstract as TestBody() is pure virtual (the various TEST | 19 // WmTestBase is abstract as TestBody() is pure virtual (the various TEST |
22 // macros have the implementation). In order to create WmTestBase we have to | 20 // macros have the implementation). In order to create WmTestBase we have to |
23 // subclass with an empty implementation of TestBody(). That's ok as the class | 21 // subclass with an empty implementation of TestBody(). That's ok as the class |
24 // isn't used as a normal test here. | 22 // isn't used as a normal test here. |
(...skipping 10 matching lines...) Expand all Loading... |
35 }; | 33 }; |
36 | 34 |
37 } // namespace | 35 } // namespace |
38 | 36 |
39 AshTestImplMus::AshTestImplMus() | 37 AshTestImplMus::AshTestImplMus() |
40 : wm_test_base_(base::MakeUnique<WmTestBaseImpl>()) {} | 38 : wm_test_base_(base::MakeUnique<WmTestBaseImpl>()) {} |
41 | 39 |
42 AshTestImplMus::~AshTestImplMus() {} | 40 AshTestImplMus::~AshTestImplMus() {} |
43 | 41 |
44 void AshTestImplMus::SetUp() { | 42 void AshTestImplMus::SetUp() { |
45 // This matches what AshTestBase does. | |
46 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | |
47 if (!command_line->HasSwitch(::switches::kHostWindowBounds)) { | |
48 command_line->AppendSwitchASCII(::switches::kHostWindowBounds, | |
49 "1+1-800x600"); | |
50 } | |
51 | |
52 wm_test_base_->SetUp(); | 43 wm_test_base_->SetUp(); |
53 } | 44 } |
54 | 45 |
55 void AshTestImplMus::TearDown() { | 46 void AshTestImplMus::TearDown() { |
56 wm_test_base_->TearDown(); | 47 wm_test_base_->TearDown(); |
57 } | 48 } |
58 | 49 |
59 void AshTestImplMus::UpdateDisplay(const std::string& display_spec) { | 50 void AshTestImplMus::UpdateDisplay(const std::string& display_spec) { |
60 wm_test_base_->UpdateDisplay(display_spec); | 51 wm_test_base_->UpdateDisplay(display_spec); |
61 } | 52 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 } | 92 } |
102 | 93 |
103 void AshTestImplMus::AddTransientChild(WmWindow* parent, WmWindow* window) { | 94 void AshTestImplMus::AddTransientChild(WmWindow* parent, WmWindow* window) { |
104 // TODO(sky): remove this as both classes can share same implementation now. | 95 // TODO(sky): remove this as both classes can share same implementation now. |
105 ::wm::AddTransientChild(WmWindow::GetAuraWindow(parent), | 96 ::wm::AddTransientChild(WmWindow::GetAuraWindow(parent), |
106 WmWindow::GetAuraWindow(window)); | 97 WmWindow::GetAuraWindow(window)); |
107 } | 98 } |
108 | 99 |
109 } // namespace mus | 100 } // namespace mus |
110 } // namespace ash | 101 } // namespace ash |
OLD | NEW |