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

Unified Diff: chrome/browser/sessions/tab_restore_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/sessions/tab_restore_browsertest.cc
diff --git a/chrome/browser/sessions/tab_restore_browsertest.cc b/chrome/browser/sessions/tab_restore_browsertest.cc
index 31f831061dac45d6d9359a61e1d7b64c0af77a68..4d6e849f829145c3d6cb8ffbd90034f64f536222 100644
--- a/chrome/browser/sessions/tab_restore_browsertest.cc
+++ b/chrome/browser/sessions/tab_restore_browsertest.cc
@@ -26,6 +26,7 @@
#include "content/public/browser/page_navigator.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/test/browser_test_utils.h"
#include "net/base/net_util.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "third_party/WebKit/public/web/WebFindOptions.h"
@@ -70,12 +71,11 @@ class TabRestoreTest : public InProcessBrowserTest {
}
void CloseTab(int index) {
- content::WindowedNotificationObserver tab_close_observer(
- content::NOTIFICATION_WEB_CONTENTS_DESTROYED,
- content::NotificationService::AllSources());
+ content::WebContentsDestroyedWatcher destroyed_watcher(
+ browser()->tab_strip_model()->GetWebContentsAt(index));
browser()->tab_strip_model()->CloseWebContentsAt(
index, TabStripModel::CLOSE_CREATE_HISTORICAL_TAB);
- tab_close_observer.Wait();
+ destroyed_watcher.Wait();
}
// Uses the undo-close-tab accelerator to undo a close-tab or close-window

Powered by Google App Engine
This is Rietveld 408576698