| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ash/mus/test/ash_test_impl_mus.h" |
| 6 |
| 7 #include "ash/common/test/ash_test.h" |
| 8 #include "ash/mus/bridge/wm_window_mus.h" |
| 9 #include "base/memory/ptr_util.h" |
| 10 #include "services/ui/public/cpp/property_type_converters.h" |
| 11 #include "services/ui/public/cpp/window.h" |
| 12 #include "services/ui/public/cpp/window_property.h" |
| 13 #include "services/ui/public/interfaces/window_manager.mojom.h" |
| 14 |
| 15 namespace ash { |
| 16 namespace mus { |
| 17 namespace { |
| 18 |
| 19 // WmTestBase is abstract as TestBody() is pure virtual (the various TEST |
| 20 // 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 |
| 22 // isn't used as a normal test here. |
| 23 class WmTestBaseImpl : public WmTestBase { |
| 24 public: |
| 25 WmTestBaseImpl() {} |
| 26 ~WmTestBaseImpl() override {} |
| 27 |
| 28 // WmTestBase: |
| 29 void TestBody() override {} |
| 30 |
| 31 private: |
| 32 DISALLOW_COPY_AND_ASSIGN(WmTestBaseImpl); |
| 33 }; |
| 34 |
| 35 } // namespace |
| 36 |
| 37 AshTestImplMus::AshTestImplMus() |
| 38 : wm_test_base_(base::MakeUnique<WmTestBaseImpl>()) {} |
| 39 |
| 40 AshTestImplMus::~AshTestImplMus() {} |
| 41 |
| 42 void AshTestImplMus::SetUp() { |
| 43 wm_test_base_->SetUp(); |
| 44 } |
| 45 |
| 46 void AshTestImplMus::TearDown() { |
| 47 wm_test_base_->TearDown(); |
| 48 } |
| 49 |
| 50 bool AshTestImplMus::SupportsMultipleDisplays() const { |
| 51 return wm_test_base_->SupportsMultipleDisplays(); |
| 52 } |
| 53 |
| 54 void AshTestImplMus::UpdateDisplay(const std::string& display_spec) { |
| 55 wm_test_base_->UpdateDisplay(display_spec); |
| 56 } |
| 57 |
| 58 std::unique_ptr<WindowOwner> AshTestImplMus::CreateTestWindow( |
| 59 const gfx::Rect& bounds_in_screen, |
| 60 ui::wm::WindowType type, |
| 61 int shell_window_id) { |
| 62 WmWindowMus* window = |
| 63 WmWindowMus::Get(wm_test_base_->CreateTestWindow(bounds_in_screen, type)); |
| 64 window->SetShellWindowId(shell_window_id); |
| 65 return base::MakeUnique<WindowOwner>(window); |
| 66 } |
| 67 |
| 68 display::Display AshTestImplMus::GetSecondaryDisplay() { |
| 69 return wm_test_base_->GetSecondaryDisplay(); |
| 70 } |
| 71 |
| 72 bool AshTestImplMus::SetSecondaryDisplayPlacement( |
| 73 display::DisplayPlacement::Position position, |
| 74 int offset) { |
| 75 NOTIMPLEMENTED(); |
| 76 return false; |
| 77 } |
| 78 |
| 79 } // namespace mus |
| 80 |
| 81 // static |
| 82 std::unique_ptr<AshTestImpl> AshTestImpl::Create() { |
| 83 return base::MakeUnique<mus::AshTestImplMus>(); |
| 84 } |
| 85 |
| 86 } // namespace ash |
| OLD | NEW |