Chromium Code Reviews| 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 class WmTestBaseImpl : public WmTestBase { | |
|
James Cook
2016/09/28 01:19:42
This is unusual, and testing::Test specifically wa
sky
2016/09/28 17:31:45
Done.
| |
| 20 public: | |
| 21 WmTestBaseImpl() {} | |
| 22 ~WmTestBaseImpl() override {} | |
| 23 | |
| 24 // WmTestBase: | |
| 25 void TestBody() override {} | |
| 26 | |
| 27 private: | |
| 28 DISALLOW_COPY_AND_ASSIGN(WmTestBaseImpl); | |
| 29 }; | |
| 30 | |
| 31 } // namespace | |
| 32 | |
| 33 AshTestImplMus::AshTestImplMus() | |
| 34 : wm_test_base_(base::MakeUnique<WmTestBaseImpl>()) {} | |
| 35 | |
| 36 AshTestImplMus::~AshTestImplMus() {} | |
| 37 | |
| 38 void AshTestImplMus::SetUp() { | |
| 39 wm_test_base_->SetUp(); | |
| 40 } | |
| 41 | |
| 42 void AshTestImplMus::TearDown() { | |
| 43 wm_test_base_->TearDown(); | |
| 44 } | |
| 45 | |
| 46 bool AshTestImplMus::SupportsMultipleDisplays() const { | |
| 47 return wm_test_base_->SupportsMultipleDisplays(); | |
| 48 } | |
| 49 | |
| 50 void AshTestImplMus::UpdateDisplay(const std::string& display_spec) { | |
| 51 wm_test_base_->UpdateDisplay(display_spec); | |
| 52 } | |
| 53 | |
| 54 std::unique_ptr<WindowOwner> AshTestImplMus::CreateTestWindow( | |
| 55 const gfx::Rect& bounds_in_screen, | |
| 56 ui::wm::WindowType type, | |
| 57 int shell_window_id) { | |
| 58 WmWindowMus* window = | |
| 59 WmWindowMus::Get(wm_test_base_->CreateTestWindow(bounds_in_screen, type)); | |
| 60 window->SetShellWindowId(shell_window_id); | |
| 61 return base::MakeUnique<WindowOwner>(window); | |
| 62 } | |
| 63 | |
| 64 display::Display AshTestImplMus::GetSecondaryDisplay() { | |
| 65 return wm_test_base_->GetSecondaryDisplay(); | |
| 66 } | |
| 67 | |
| 68 bool AshTestImplMus::SetSecondaryDisplayPlacement( | |
| 69 display::DisplayPlacement::Position position, | |
| 70 int offset) { | |
| 71 NOTIMPLEMENTED(); | |
| 72 return false; | |
| 73 } | |
| 74 | |
| 75 void AshTestImplMus::ConfigureWidgetInitParamsForDisplay( | |
| 76 WmWindow* window, | |
| 77 views::Widget::InitParams* init_params) { | |
| 78 NOTIMPLEMENTED(); | |
| 79 } | |
| 80 | |
| 81 } // namespace mus | |
| 82 | |
| 83 // static | |
| 84 std::unique_ptr<AshTestImpl> AshTestImpl::Create() { | |
| 85 return base::MakeUnique<mus::AshTestImplMus>(); | |
| 86 } | |
| 87 | |
| 88 } // namespace ash | |
| OLD | NEW |