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

Unified Diff: content/test/test_navigation_observer.cc

Issue 10803026: Get content_browsertest working. I've added a simple test for now, and will convert the tests in sr… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: get it working on mac + linux, fix unittests crash, and fix unittest link error and add missing dep… Created 8 years, 5 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
« no previous file with comments | « content/test/test_launcher.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/test_navigation_observer.cc
===================================================================
--- content/test/test_navigation_observer.cc (revision 147044)
+++ content/test/test_navigation_observer.cc (working copy)
@@ -10,26 +10,12 @@
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
#include "content/public/browser/render_view_host_observer.h"
+#include "content/public/test/browser_test_utils.h"
#include "content/public/test/js_injection_ready_observer.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace content {
-namespace {
-
-// Allow some pending tasks up to |num_deferrals| generations to complete.
-void DeferredQuitRunLoop(const base::Closure& quit_task,
- int num_quit_deferrals) {
- if (num_quit_deferrals <= 0) {
- quit_task.Run();
- } else {
- MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(&DeferredQuitRunLoop, quit_task, num_quit_deferrals - 1));
- }
-}
-
-} // namespace
-
// This class observes |render_view_host| and calls OnJsInjectionReady() of
// |js_injection_ready_observer| when the time is right to inject JavaScript
// into the page.
@@ -101,13 +87,9 @@
void TestNavigationObserver::Wait() {
base::RunLoop run_loop;
- // Number of times to repost Quit task to allow pending tasks to complete. See
- // kNumQuitDeferrals in ui_test_utils.cc for explanation.
- const int num_quit_deferrals = 10;
WaitForObservation(
base::Bind(&base::RunLoop::Run, base::Unretained(&run_loop)),
- base::Bind(&DeferredQuitRunLoop, run_loop.QuitClosure(),
- num_quit_deferrals));
+ content::GetQuitTaskForRunLoop(&run_loop));
}
TestNavigationObserver::TestNavigationObserver(
« no previous file with comments | « content/test/test_launcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698