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

Unified Diff: ash/common/system/tray/system_tray_unittest.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 | « no previous file | ash/frame/default_header_painter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/tray/system_tray_unittest.cc
diff --git a/ash/common/system/tray/system_tray_unittest.cc b/ash/common/system/tray/system_tray_unittest.cc
index 4f20c194dd23fd009ff0edac474927000bc50d1c..19ab75ce2c26faed7e1ca2a3658289299fea5a66 100644
--- a/ash/common/system/tray/system_tray_unittest.cc
+++ b/ash/common/system/tray/system_tray_unittest.cc
@@ -42,23 +42,6 @@ namespace test {
namespace {
-std::unique_ptr<views::Widget> CreateTestWidget(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 = gfx::Rect(0, 0, 100, 100);
- WmShell::Get()
- ->GetPrimaryRootWindow()
- ->GetRootWindowController()
- ->ConfigureWidgetInitParamsForContainer(widget.get(), container_id,
- &params);
- widget->Init(params);
- widget->Show();
- return widget;
-}
-
// Trivial item implementation that tracks its views for testing.
class TestItem : public SystemTrayItem {
public:
@@ -404,8 +387,8 @@ TEST_F(SystemTrayTest, PersistentBubble) {
TestItem* test_item = new TestItem;
tray->AddTrayItem(test_item);
- std::unique_ptr<views::Widget> widget(
- CreateTestWidget(nullptr, kShellWindowId_DefaultContainer));
+ std::unique_ptr<views::Widget> widget(CreateTestWidget(
+ nullptr, kShellWindowId_DefaultContainer, gfx::Rect(0, 0, 100, 100)));
// Tests for usual default view while activating a window.
tray->ShowDefaultView(BUBBLE_CREATE_NEW);
@@ -448,7 +431,8 @@ TEST_F(SystemTrayTest, MAYBE_WithSystemModal) {
// Check if the accessibility item is created even with system modal dialog.
WmShell::Get()->GetAccessibilityDelegate()->SetVirtualKeyboardEnabled(true);
std::unique_ptr<views::Widget> widget(CreateTestWidget(
- new ModalWidgetDelegate, kShellWindowId_SystemModalContainer));
+ new ModalWidgetDelegate, kShellWindowId_SystemModalContainer,
+ gfx::Rect(0, 0, 100, 100)));
SystemTray* tray = GetPrimarySystemTray();
tray->ShowDefaultView(BUBBLE_CREATE_NEW);
« no previous file with comments | « no previous file | ash/frame/default_header_painter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698