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