Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2345)

Unified Diff: ash/common/test/ash_test.cc

Issue 2734653002: chromeos: Move files in //ash/common to //ash (Closed)
Patch Set: fix a11y tests, fix docs Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/common/test/ash_test.h ('k') | ash/common/test/ash_test_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/test/ash_test.cc
diff --git a/ash/common/test/ash_test.cc b/ash/common/test/ash_test.cc
deleted file mode 100644
index ba087ec2cf9e4dcf62b382fc230d20fc8895b3c8..0000000000000000000000000000000000000000
--- a/ash/common/test/ash_test.cc
+++ /dev/null
@@ -1,143 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ash/common/test/ash_test.h"
-
-#include "ash/common/shelf/wm_shelf.h"
-#include "ash/common/system/status_area_widget.h"
-#include "ash/common/test/ash_test_impl.h"
-#include "ash/common/test/test_session_state_delegate.h"
-#include "ash/common/test/test_system_tray_delegate.h"
-#include "ash/common/wm_shell.h"
-#include "ash/common/wm_window.h"
-#include "ash/root_window_controller.h"
-#include "base/memory/ptr_util.h"
-#include "base/run_loop.h"
-#include "ui/compositor/layer_type.h"
-#include "ui/display/display.h"
-
-namespace ash {
-
-WindowOwner::WindowOwner(WmWindow* window) : window_(window) {}
-
-WindowOwner::~WindowOwner() {
- window_->Destroy();
-}
-
-AshTest::AshTest() : test_impl_(AshTestImpl::Create()) {}
-
-AshTest::~AshTest() {}
-
-// static
-WmShelf* AshTest::GetPrimaryShelf() {
- return WmShell::Get()
- ->GetPrimaryRootWindow()
- ->GetRootWindowController()
- ->GetShelf();
-}
-
-// static
-SystemTray* AshTest::GetPrimarySystemTray() {
- return GetPrimaryShelf()->GetStatusAreaWidget()->system_tray();
-}
-
-// static
-test::TestSystemTrayDelegate* AshTest::GetSystemTrayDelegate() {
- return static_cast<test::TestSystemTrayDelegate*>(
- WmShell::Get()->system_tray_delegate());
-}
-
-void AshTest::UpdateDisplay(const std::string& display_spec) {
- return test_impl_->UpdateDisplay(display_spec);
-}
-
-std::unique_ptr<WindowOwner> AshTest::CreateTestWindow(const gfx::Rect& bounds,
- ui::wm::WindowType type,
- int shell_window_id) {
- return test_impl_->CreateTestWindow(bounds, type, shell_window_id);
-}
-
-std::unique_ptr<WindowOwner> AshTest::CreateToplevelTestWindow(
- const gfx::Rect& bounds_in_screen,
- int shell_window_id) {
- return test_impl_->CreateToplevelTestWindow(bounds_in_screen,
- shell_window_id);
-}
-
-std::unique_ptr<WindowOwner> AshTest::CreateChildWindow(WmWindow* parent,
- const gfx::Rect& bounds,
- int shell_window_id) {
- std::unique_ptr<WindowOwner> window_owner =
- base::MakeUnique<WindowOwner>(WmShell::Get()->NewWindow(
- ui::wm::WINDOW_TYPE_NORMAL, ui::LAYER_NOT_DRAWN));
- window_owner->window()->SetBounds(bounds);
- window_owner->window()->SetShellWindowId(shell_window_id);
- parent->AddChild(window_owner->window());
- window_owner->window()->Show();
- return window_owner;
-}
-
-// static
-std::unique_ptr<views::Widget> AshTest::CreateTestWidget(
- const gfx::Rect& bounds,
- views::WidgetDelegate* delegate,
- int container_id) {
- std::unique_ptr<views::Widget> widget(new views::Widget);
- views::Widget::InitParams params;
- params.delegate = delegate;
- params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
- params.bounds = bounds;
- WmShell::Get()
- ->GetPrimaryRootWindow()
- ->GetRootWindowController()
- ->ConfigureWidgetInitParamsForContainer(widget.get(), container_id,
- &params);
- widget->Init(params);
- widget->Show();
- return widget;
-}
-
-display::Display AshTest::GetSecondaryDisplay() {
- return test_impl_->GetSecondaryDisplay();
-}
-
-bool AshTest::SetSecondaryDisplayPlacement(
- display::DisplayPlacement::Position position,
- int offset) {
- if (WmShell::Get()->IsRunningInMash()) {
- NOTIMPLEMENTED();
- return false;
- }
- return test_impl_->SetSecondaryDisplayPlacement(position, offset);
-}
-
-void AshTest::ConfigureWidgetInitParamsForDisplay(
- WmWindow* window,
- views::Widget::InitParams* init_params) {
- test_impl_->ConfigureWidgetInitParamsForDisplay(window, init_params);
-}
-
-void AshTest::ParentWindowInPrimaryRootWindow(WmWindow* window) {
- window->SetParentUsingContext(WmShell::Get()->GetPrimaryRootWindow(),
- gfx::Rect());
-}
-
-void AshTest::AddTransientChild(WmWindow* parent, WmWindow* window) {
- test_impl_->AddTransientChild(parent, window);
-}
-
-void AshTest::RunAllPendingInMessageLoop() {
- base::RunLoop run_loop;
- run_loop.RunUntilIdle();
-}
-
-void AshTest::SetUp() {
- test_impl_->SetUp();
-}
-
-void AshTest::TearDown() {
- test_impl_->TearDown();
-}
-
-} // namespace ash
« no previous file with comments | « ash/common/test/ash_test.h ('k') | ash/common/test/ash_test_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698