| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/public/test/test_navigation_observer.h" | 5 #include "content/public/test/test_navigation_observer.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "content/public/browser/notification_service.h" | 10 #include "content/public/browser/notification_service.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 running_ = true; | 82 running_ = true; |
| 83 done_callback_ = done_callback; | 83 done_callback_ = done_callback; |
| 84 wait_loop_callback.Run(); | 84 wait_loop_callback.Run(); |
| 85 EXPECT_TRUE(done_); | 85 EXPECT_TRUE(done_); |
| 86 } | 86 } |
| 87 | 87 |
| 88 void TestNavigationObserver::Wait() { | 88 void TestNavigationObserver::Wait() { |
| 89 base::RunLoop run_loop; | 89 base::RunLoop run_loop; |
| 90 WaitForObservation( | 90 WaitForObservation( |
| 91 base::Bind(&base::RunLoop::Run, base::Unretained(&run_loop)), | 91 base::Bind(&base::RunLoop::Run, base::Unretained(&run_loop)), |
| 92 content::GetQuitTaskForRunLoop(&run_loop)); | 92 GetQuitTaskForRunLoop(&run_loop)); |
| 93 } | 93 } |
| 94 | 94 |
| 95 TestNavigationObserver::TestNavigationObserver( | 95 TestNavigationObserver::TestNavigationObserver( |
| 96 JsInjectionReadyObserver* js_injection_ready_observer, | 96 JsInjectionReadyObserver* js_injection_ready_observer, |
| 97 int number_of_navigations) | 97 int number_of_navigations) |
| 98 : navigation_started_(false), | 98 : navigation_started_(false), |
| 99 navigations_completed_(0), | 99 navigations_completed_(0), |
| 100 number_of_navigations_(number_of_navigations), | 100 number_of_navigations_(number_of_navigations), |
| 101 js_injection_ready_observer_(js_injection_ready_observer), | 101 js_injection_ready_observer_(js_injection_ready_observer), |
| 102 done_(false), | 102 done_(false), |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 rvho_send_js_.reset(new RVHOSendJS( | 142 rvho_send_js_.reset(new RVHOSendJS( |
| 143 Source<RenderViewHost>(source).ptr(), | 143 Source<RenderViewHost>(source).ptr(), |
| 144 js_injection_ready_observer_)); | 144 js_injection_ready_observer_)); |
| 145 break; | 145 break; |
| 146 default: | 146 default: |
| 147 NOTREACHED(); | 147 NOTREACHED(); |
| 148 } | 148 } |
| 149 } | 149 } |
| 150 | 150 |
| 151 } // namespace content | 151 } // namespace content |
| OLD | NEW |