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

Unified Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc

Issue 26277010: Create content::WebContentsDestroyedWatcher, use it in many tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 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: chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc
index 3addbf6dd80bd8453f13d2d8c68a3b2867dffff7..830663bce328e9d713a7852b12efe38e4b83429f 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc
@@ -49,6 +49,7 @@
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/test/browser_test_utils.h"
#include "extensions/common/switches.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/app_list/views/apps_grid_view.h"
@@ -846,11 +847,9 @@ IN_PROC_BROWSER_TEST_F(LauncherAppBrowserTest, LaunchPinned) {
EXPECT_EQ(++tab_count, tab_strip->count());
EXPECT_EQ(ash::STATUS_ACTIVE, (*model_->ItemByID(shortcut_id)).status);
WebContents* tab = tab_strip->GetActiveWebContents();
- content::WindowedNotificationObserver close_observer(
- content::NOTIFICATION_WEB_CONTENTS_DESTROYED,
- content::Source<WebContents>(tab));
+ content::WebContentsDestroyedWatcher destroyed_watcher(tab);
browser()->tab_strip_model()->CloseSelectedTabs();
- close_observer.Wait();
+ destroyed_watcher.Wait();
EXPECT_EQ(--tab_count, tab_strip->count());
EXPECT_EQ(ash::STATUS_CLOSED, (*model_->ItemByID(shortcut_id)).status);
}
@@ -865,11 +864,9 @@ IN_PROC_BROWSER_TEST_F(LauncherAppBrowserTest, LaunchUnpinned) {
ash::LauncherID shortcut_id = CreateShortcut("app1");
EXPECT_EQ(ash::STATUS_ACTIVE, (*model_->ItemByID(shortcut_id)).status);
WebContents* tab = tab_strip->GetActiveWebContents();
- content::WindowedNotificationObserver close_observer(
- content::NOTIFICATION_WEB_CONTENTS_DESTROYED,
- content::Source<WebContents>(tab));
+ content::WebContentsDestroyedWatcher destroyed_watcher(tab);
browser()->tab_strip_model()->CloseSelectedTabs();
- close_observer.Wait();
+ destroyed_watcher.Wait();
EXPECT_EQ(--tab_count, tab_strip->count());
EXPECT_EQ(ash::STATUS_CLOSED, (*model_->ItemByID(shortcut_id)).status);
}

Powered by Google App Engine
This is Rietveld 408576698