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/test/ash_test_impl_aura.h" | |
| 6 | |
| 7 #include "ash/aura/wm_window_aura.h" | |
| 8 #include "ash/common/test/ash_test.h" | |
| 9 #include "ash/display/display_manager.h" | |
| 10 #include "ash/screen_util.h" | |
| 11 #include "ash/shell.h" | |
| 12 #include "ash/test/ash_test_base.h" | |
| 13 #include "ash/test/display_manager_test_api.h" | |
| 14 #include "base/memory/ptr_util.h" | |
| 15 #include "ui/display/manager/display_layout.h" | |
| 16 #include "ui/display/screen.h" | |
| 17 | |
| 18 namespace ash { | |
| 19 namespace { | |
| 20 | |
| 21 class AshTestBaseImpl : public test::AshTestBase { | |
|
James Cook
2016/09/28 01:19:42
ditto, as with the other one
sky
2016/09/28 17:31:45
Done.
| |
| 22 public: | |
| 23 AshTestBaseImpl() {} | |
| 24 ~AshTestBaseImpl() override {} | |
| 25 | |
| 26 // AshTestBase: | |
| 27 void TestBody() override {} | |
| 28 | |
| 29 private: | |
| 30 DISALLOW_COPY_AND_ASSIGN(AshTestBaseImpl); | |
| 31 }; | |
| 32 | |
| 33 } // namespace | |
| 34 | |
| 35 AshTestImplAura::AshTestImplAura() | |
| 36 : ash_test_base_(base::MakeUnique<AshTestBaseImpl>()) {} | |
| 37 | |
| 38 AshTestImplAura::~AshTestImplAura() {} | |
| 39 | |
| 40 void AshTestImplAura::SetUp() { | |
| 41 ash_test_base_->SetUp(); | |
| 42 } | |
| 43 | |
| 44 void AshTestImplAura::TearDown() { | |
| 45 ash_test_base_->TearDown(); | |
| 46 } | |
| 47 | |
| 48 bool AshTestImplAura::SupportsMultipleDisplays() const { | |
| 49 return ash_test_base_->SupportsMultipleDisplays(); | |
| 50 } | |
| 51 | |
| 52 void AshTestImplAura::UpdateDisplay(const std::string& display_spec) { | |
| 53 ash_test_base_->UpdateDisplay(display_spec); | |
| 54 } | |
| 55 | |
| 56 std::unique_ptr<WindowOwner> AshTestImplAura::CreateTestWindow( | |
| 57 const gfx::Rect& bounds_in_screen, | |
| 58 ui::wm::WindowType type, | |
| 59 int shell_window_id) { | |
| 60 return base::MakeUnique<WindowOwner>(WmWindowAura::Get( | |
| 61 ash_test_base_->CreateTestWindowInShellWithDelegateAndType( | |
| 62 nullptr, type, shell_window_id, bounds_in_screen))); | |
| 63 } | |
| 64 | |
| 65 display::Display AshTestImplAura::GetSecondaryDisplay() { | |
| 66 return ScreenUtil::GetSecondaryDisplay(); | |
| 67 } | |
| 68 | |
| 69 bool AshTestImplAura::SetSecondaryDisplayPlacement( | |
| 70 display::DisplayPlacement::Position position, | |
| 71 int offset) { | |
| 72 Shell::GetInstance()->display_manager()->SetLayoutForCurrentDisplays( | |
| 73 test::CreateDisplayLayout(display::DisplayPlacement::TOP, 0)); | |
|
James Cook
2016/09/28 01:19:42
TOP seems like an odd default placement. Is that i
sky
2016/09/28 17:31:45
Actually, it should be position.
| |
| 74 return true; | |
| 75 } | |
| 76 | |
| 77 void AshTestImplAura::ConfigureWidgetInitParamsForDisplay( | |
| 78 WmWindow* window, | |
| 79 views::Widget::InitParams* init_params) { | |
| 80 init_params->context = WmWindowAura::GetAuraWindow(window); | |
| 81 } | |
| 82 | |
| 83 // static | |
| 84 std::unique_ptr<AshTestImpl> AshTestImpl::Create() { | |
| 85 return base::MakeUnique<AshTestImplAura>(); | |
| 86 } | |
| 87 | |
| 88 } // namespace ash | |
| OLD | NEW |