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

Unified Diff: chrome/browser/apps/app_browsertest_util.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/apps/app_browsertest_util.cc
diff --git a/chrome/browser/apps/app_browsertest_util.cc b/chrome/browser/apps/app_browsertest_util.cc
index 7eb201d691716257c79e947b93d84209bc931d55..31d56165ca3c4dcd3ace5346019421d7ca1ad645 100644
--- a/chrome/browser/apps/app_browsertest_util.cc
+++ b/chrome/browser/apps/app_browsertest_util.cc
@@ -16,6 +16,7 @@
#include "chrome/browser/ui/extensions/application_launch.h"
#include "chrome/common/chrome_switches.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/test/browser_test_utils.h"
#include "content/public/test/test_utils.h"
#include "extensions/common/switches.h"
@@ -171,11 +172,10 @@ ShellWindow* PlatformAppBrowserTest::CreateShellWindowFromParams(
}
void PlatformAppBrowserTest::CloseShellWindow(ShellWindow* window) {
- content::WindowedNotificationObserver destroyed_observer(
- content::NOTIFICATION_WEB_CONTENTS_DESTROYED,
- content::NotificationService::AllSources());
+ content::WebContentsDestroyedWatcher destroyed_watcher(
+ window->web_contents());
window->GetBaseWindow()->Close();
- destroyed_observer.Wait();
+ destroyed_watcher.Wait();
}
void PlatformAppBrowserTest::CallAdjustBoundsToBeVisibleOnScreenForShellWindow(

Powered by Google App Engine
This is Rietveld 408576698