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

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

Issue 2391153002: Converts most of WorkspaceLayoutManager tests to use common code (Closed)
Patch Set: cleanup Created 4 years, 2 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
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..86aab9bb1c0bd42c6649c5a554d5671097cdf07b 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"
@@ -36,6 +39,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 +69,40 @@ 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);
+}
+
+WmShelf* AshTest::GetPrimaryShelf() {
+ return WmShell::Get()
+ ->GetPrimaryRootWindow()
+ ->GetRootWindowController()
+ ->GetShelf();
+}
+
+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();
}

Powered by Google App Engine
This is Rietveld 408576698