Chromium Code Reviews| Index: content/test/test_navigation_observer.cc |
| diff --git a/content/test/test_navigation_observer.cc b/content/test/test_navigation_observer.cc |
| index 89ff36fd575feb8ec98c98463596d8c7442c5a2e..208b6889d9f88db85b56b96299dc9b0eb076254a 100644 |
| --- a/content/test/test_navigation_observer.cc |
| +++ b/content/test/test_navigation_observer.cc |
| @@ -84,11 +84,14 @@ void TestNavigationObserver::WaitForObservation( |
| } |
| void TestNavigationObserver::Wait() { |
| + int message_loop_run_id = MessageLoop::current()->next_run_id(); |
|
jar (doing other things)
2012/06/14 04:50:29
re: discussion of changing API from next_run_id().
jbates
2012/06/15 02:20:38
Done.
|
| WaitForObservation( |
| base::Bind(&MessageLoop::Run, |
| base::Unretained(MessageLoop::current())), |
| - base::Bind(&MessageLoop::Quit, |
| - base::Unretained(MessageLoop::current()))); |
| + base::Bind(&MessageLoop::PostTask, |
| + base::Unretained(MessageLoop::current()), |
| + FROM_HERE, |
| + MessageLoop::QuitNowByIDClosure(message_loop_run_id))); |
| } |
| TestNavigationObserver::TestNavigationObserver( |
| @@ -131,8 +134,10 @@ void TestNavigationObserver::Observe( |
| ++navigations_completed_ == number_of_navigations_) { |
| navigation_started_ = false; |
| done_ = true; |
| - if (running_) |
| + if (running_) { |
| + running_ = false; |
| done_callback_.Run(); |
| + } |
| } |
| break; |
| case NOTIFICATION_RENDER_VIEW_HOST_CREATED: |