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

Unified Diff: ash/test/ash_test_base.cc

Issue 2144003003: Add CreateTestWidget() to AshTestBase, collapse duplicates (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@movetray
Patch Set: rebase Created 4 years, 5 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/test/ash_test_base.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/test/ash_test_base.cc
diff --git a/ash/test/ash_test_base.cc b/ash/test/ash_test_base.cc
index c6d860953b8f5cef0f6a158067340660b43f6b05..c5c301b94d6d9ebc116f34a7265da4d95fab848e 100644
--- a/ash/test/ash_test_base.cc
+++ b/ash/test/ash_test_base.cc
@@ -223,6 +223,26 @@ aura::Window* AshTestBase::CurrentContext() {
return ash_test_helper_->CurrentContext();
}
+// static
+std::unique_ptr<views::Widget> AshTestBase::CreateTestWidget(
+ views::WidgetDelegate* delegate,
+ int container_id,
+ const gfx::Rect& bounds) {
+ 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;
+}
+
aura::Window* AshTestBase::CreateTestWindowInShellWithId(int id) {
return CreateTestWindowInShellWithDelegate(NULL, id, gfx::Rect());
}
« no previous file with comments | « ash/test/ash_test_base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698