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 #ifndef CONTENT_PUBLIC_TEST_TEST_NAVIGATION_OBSERVER_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_TEST_NAVIGATION_OBSERVER_H_ |
6 #define CONTENT_PUBLIC_TEST_TEST_NAVIGATION_OBSERVER_H_ | 6 #define CONTENT_PUBLIC_TEST_TEST_NAVIGATION_OBSERVER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 int number_of_navigations, | 26 int number_of_navigations, |
27 MessageLoopRunner::QuitMode quit_mode = | 27 MessageLoopRunner::QuitMode quit_mode = |
28 MessageLoopRunner::QuitMode::IMMEDIATE); | 28 MessageLoopRunner::QuitMode::IMMEDIATE); |
29 // Like above but waits for one navigation. | 29 // Like above but waits for one navigation. |
30 explicit TestNavigationObserver(WebContents* web_contents, | 30 explicit TestNavigationObserver(WebContents* web_contents, |
31 MessageLoopRunner::QuitMode quit_mode = | 31 MessageLoopRunner::QuitMode quit_mode = |
32 MessageLoopRunner::QuitMode::IMMEDIATE); | 32 MessageLoopRunner::QuitMode::IMMEDIATE); |
33 | 33 |
34 virtual ~TestNavigationObserver(); | 34 virtual ~TestNavigationObserver(); |
35 | 35 |
36 // Runs a nested message loop and blocks until the expected number of | 36 // Runs a nested run loop and blocks until the expected number of |
37 // navigations are complete. | 37 // navigations are complete. |
38 void Wait(); | 38 void Wait(); |
39 | 39 |
40 // Start/stop watching newly created WebContents. | 40 // Start/stop watching newly created WebContents. |
41 void StartWatchingNewWebContents(); | 41 void StartWatchingNewWebContents(); |
42 void StopWatchingNewWebContents(); | 42 void StopWatchingNewWebContents(); |
43 | 43 |
44 const GURL& last_navigation_url() const { return last_navigation_url_; } | 44 const GURL& last_navigation_url() const { return last_navigation_url_; } |
45 | 45 |
46 int last_navigation_succeeded() const { return last_navigation_succeeded_; } | 46 int last_navigation_succeeded() const { return last_navigation_succeeded_; } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 89 |
90 // Living TestWebContentsObservers created by this observer. | 90 // Living TestWebContentsObservers created by this observer. |
91 std::set<std::unique_ptr<TestWebContentsObserver>> web_contents_observers_; | 91 std::set<std::unique_ptr<TestWebContentsObserver>> web_contents_observers_; |
92 | 92 |
93 DISALLOW_COPY_AND_ASSIGN(TestNavigationObserver); | 93 DISALLOW_COPY_AND_ASSIGN(TestNavigationObserver); |
94 }; | 94 }; |
95 | 95 |
96 } // namespace content | 96 } // namespace content |
97 | 97 |
98 #endif // CONTENT_PUBLIC_TEST_TEST_NAVIGATION_OBSERVER_H_ | 98 #endif // CONTENT_PUBLIC_TEST_TEST_NAVIGATION_OBSERVER_H_ |
OLD | NEW |