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

Unified Diff: content/public/test/browser_test_utils.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: content/public/test/browser_test_utils.cc
diff --git a/content/public/test/browser_test_utils.cc b/content/public/test/browser_test_utils.cc
index bed85a55670b7c4eea306322aa3a7989644cdcb4..f16b854fc707bbd9141510ca527da68ba748472c 100644
--- a/content/public/test/browser_test_utils.cc
+++ b/content/public/test/browser_test_utils.cc
@@ -582,6 +582,25 @@ void TitleWatcher::TestTitle() {
message_loop_runner_->Quit();
}
+WebContentsDestroyedWatcher::WebContentsDestroyedWatcher(
+ WebContents* web_contents)
+ : WebContentsObserver(web_contents),
+ message_loop_runner_(new MessageLoopRunner) {
+ EXPECT_TRUE(web_contents != NULL);
+}
+
+WebContentsDestroyedWatcher::~WebContentsDestroyedWatcher() {
+}
+
+void WebContentsDestroyedWatcher::Wait() {
+ message_loop_runner_->Run();
+}
+
+void WebContentsDestroyedWatcher::WebContentsDestroyed(
+ WebContents* web_contents) {
+ message_loop_runner_->Quit();
+}
+
DOMMessageQueue::DOMMessageQueue() : waiting_for_message_(false) {
registrar_.Add(this, NOTIFICATION_DOM_OPERATION_RESPONSE,
NotificationService::AllSources());
« content/public/test/browser_test_utils.h ('K') | « content/public/test/browser_test_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698