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

Unified Diff: ash/system/web_notification/web_notification_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 | « ash/system/web_notification/ash_popup_alignment_delegate_unittest.cc ('k') | ash/test/ash_test_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/web_notification/web_notification_tray_unittest.cc
diff --git a/ash/system/web_notification/web_notification_tray_unittest.cc b/ash/system/web_notification/web_notification_tray_unittest.cc
index 96714dae161a28a8eda51a2a607f10fb6b88b469..00594313e5d16c329eafa5f771d66b51cc09b950 100644
--- a/ash/system/web_notification/web_notification_tray_unittest.cc
+++ b/ash/system/web_notification/web_notification_tray_unittest.cc
@@ -15,8 +15,6 @@
#include "ash/common/system/web_notification/ash_popup_alignment_delegate.h"
#include "ash/common/wm/window_state.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
-#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/display/display_manager.h"
#include "ash/shell.h"
@@ -144,19 +142,9 @@ class WebNotificationTrayTest : public test::AshTestBase {
bool IsPopupVisible() { return GetTray()->IsPopupVisible(); }
- std::unique_ptr<views::Widget> CreateTestWidget() {
- std::unique_ptr<views::Widget> widget(new views::Widget);
- views::Widget::InitParams params;
- params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
- params.bounds = gfx::Rect(1, 2, 3, 4);
- WmShell::Get()
- ->GetPrimaryRootWindow()
- ->GetRootWindowController()
- ->ConfigureWidgetInitParamsForContainer(
- widget.get(), kShellWindowId_DefaultContainer, &params);
- widget->Init(params);
- widget->Show();
- return widget;
+ static std::unique_ptr<views::Widget> CreateTestWidget() {
+ return AshTestBase::CreateTestWidget(
+ nullptr, kShellWindowId_DefaultContainer, gfx::Rect(1, 2, 3, 4));
}
private:
« no previous file with comments | « ash/system/web_notification/ash_popup_alignment_delegate_unittest.cc ('k') | ash/test/ash_test_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698