Index: ash/common/test/ash_test.cc |
diff --git a/ash/common/test/ash_test.cc b/ash/common/test/ash_test.cc |
index 88030968a8bf716a2ebddbacd6d7c10ef3306ee9..4e9fd3205f502301b0992f9835f7f68f1cda8b3e 100644 |
--- a/ash/common/test/ash_test.cc |
+++ b/ash/common/test/ash_test.cc |
@@ -5,8 +5,11 @@ |
#include "ash/common/test/ash_test.h" |
#include "ash/common/test/ash_test_impl.h" |
+#include "ash/common/wm_root_window_controller.h" |
#include "ash/common/wm_shell.h" |
#include "ash/common/wm_window.h" |
+#include "ash/test/test_session_state_delegate.h" |
+#include "base/run_loop.h" |
#include "ui/compositor/layer_type.h" |
#include "ui/display/display.h" |
@@ -22,6 +25,19 @@ AshTest::AshTest() : test_impl_(AshTestImpl::Create()) {} |
AshTest::~AshTest() {} |
+// static |
+bool AshTest::IsRunningInMash() { |
+ return WmShell::Get()->IsRunningInMash(); |
+} |
+ |
+// static |
+WmShelf* AshTest::GetPrimaryShelf() { |
+ return WmShell::Get() |
+ ->GetPrimaryRootWindow() |
+ ->GetRootWindowController() |
+ ->GetShelf(); |
+} |
+ |
bool AshTest::SupportsMultipleDisplays() const { |
return test_impl_->SupportsMultipleDisplays(); |
} |
@@ -36,6 +52,13 @@ std::unique_ptr<WindowOwner> AshTest::CreateTestWindow(const gfx::Rect& bounds, |
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) { |
@@ -59,6 +82,33 @@ bool AshTest::SetSecondaryDisplayPlacement( |
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::SetCanLockScreen(bool can_lock_screen) { |
+ CHECK(WmShell::HasInstance()); |
+ static_cast<ash::test::TestSessionStateDelegate*>( |
+ WmShell::Get()->GetSessionStateDelegate()) |
+ ->SetCanLockScreen(can_lock_screen); |
+} |
+ |
+void AshTest::RunAllPendingInMessageLoop() { |
+ base::RunLoop run_loop; |
+ run_loop.RunUntilIdle(); |
+} |
+ |
void AshTest::SetUp() { |
test_impl_->SetUp(); |
} |