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

Unified Diff: chrome/browser/browser_keyevents_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/browser_keyevents_browsertest.cc
diff --git a/chrome/browser/browser_keyevents_browsertest.cc b/chrome/browser/browser_keyevents_browsertest.cc
index 77f10c47831fc46b266f2e573be723051e57f2ee..0a2580839fe3d62b6308daff86fcceb9ccb44fed 100644
--- a/chrome/browser/browser_keyevents_browsertest.cc
+++ b/chrome/browser/browser_keyevents_browsertest.cc
@@ -723,10 +723,8 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, MAYBE_ReservedAccelerators) {
// Reserved accelerators can't be suppressed.
ASSERT_NO_FATAL_FAILURE(SuppressAllEvents(1, true));
- content::WindowedNotificationObserver wait_for_tab_closed(
- content::NOTIFICATION_WEB_CONTENTS_DESTROYED,
- content::Source<content::WebContents>(
- browser()->tab_strip_model()->GetWebContentsAt(1)));
+ content::WebContentsDestroyedWatcher destroyed_watcher(
+ browser()->tab_strip_model()->GetWebContentsAt(1));
// Press Ctrl/Cmd+W, which will close the tab.
#if defined(OS_MACOSX)
@@ -737,7 +735,7 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, MAYBE_ReservedAccelerators) {
browser(), ui::VKEY_W, true, false, false, false));
#endif
- ASSERT_NO_FATAL_FAILURE(wait_for_tab_closed.Wait());
+ ASSERT_NO_FATAL_FAILURE(destroyed_watcher.Wait());
EXPECT_EQ(1, browser()->tab_strip_model()->count());
}

Powered by Google App Engine
This is Rietveld 408576698