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

Unified Diff: ash/test/ash_test_impl_aura.cc

Issue 2391153002: Converts most of WorkspaceLayoutManager tests to use common code (Closed)
Patch Set: merge 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/test/ash_test_impl_aura.cc
diff --git a/ash/test/ash_test_impl_aura.cc b/ash/test/ash_test_impl_aura.cc
index cf32bc448a44aced969712b2d212f14cd3bffe4c..d627ea32b7811e69dd96420b653e31f2f96ea8ab 100644
--- a/ash/test/ash_test_impl_aura.cc
+++ b/ash/test/ash_test_impl_aura.cc
@@ -12,8 +12,10 @@
#include "ash/test/ash_test_base.h"
#include "ash/test/display_manager_test_api.h"
#include "base/memory/ptr_util.h"
+#include "ui/aura/test/test_window_delegate.h"
#include "ui/display/manager/display_layout.h"
#include "ui/display/screen.h"
+#include "ui/wm/core/window_util.h"
namespace ash {
namespace {
@@ -66,6 +68,17 @@ std::unique_ptr<WindowOwner> AshTestImplAura::CreateTestWindow(
nullptr, type, shell_window_id, bounds_in_screen)));
}
+std::unique_ptr<WindowOwner> AshTestImplAura::CreateToplevelTestWindow(
+ const gfx::Rect& bounds_in_screen,
+ int shell_window_id) {
+ aura::test::TestWindowDelegate* delegate =
+ aura::test::TestWindowDelegate::CreateSelfDestroyingDelegate();
+ return base::MakeUnique<WindowOwner>(WmWindowAura::Get(
+ ash_test_base_->CreateTestWindowInShellWithDelegateAndType(
+ delegate, ui::wm::WINDOW_TYPE_NORMAL, shell_window_id,
+ bounds_in_screen)));
+}
+
display::Display AshTestImplAura::GetSecondaryDisplay() {
return ScreenUtil::GetSecondaryDisplay();
}
@@ -78,6 +91,17 @@ bool AshTestImplAura::SetSecondaryDisplayPlacement(
return true;
}
+void AshTestImplAura::ConfigureWidgetInitParamsForDisplay(
+ WmWindow* window,
+ views::Widget::InitParams* init_params) {
+ init_params->context = WmWindowAura::GetAuraWindow(window);
+}
+
+void AshTestImplAura::AddTransientChild(WmWindow* parent, WmWindow* window) {
+ ::wm::AddTransientChild(WmWindowAura::GetAuraWindow(parent),
+ WmWindowAura::GetAuraWindow(window));
+}
+
// static
std::unique_ptr<AshTestImpl> AshTestImpl::Create() {
return base::MakeUnique<AshTestImplAura>();

Powered by Google App Engine
This is Rietveld 408576698