| 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_BROWSER_TEST_UTILS_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ |
| 6 #define CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ | 6 #define CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 // Adds another title to watch for. | 263 // Adds another title to watch for. |
| 264 void AlsoWaitForTitle(const base::string16& expected_title); | 264 void AlsoWaitForTitle(const base::string16& expected_title); |
| 265 | 265 |
| 266 // Waits until the title matches either expected_title or one of the titles | 266 // Waits until the title matches either expected_title or one of the titles |
| 267 // added with AlsoWaitForTitle. Returns the value of the most recently | 267 // added with AlsoWaitForTitle. Returns the value of the most recently |
| 268 // observed matching title. | 268 // observed matching title. |
| 269 const base::string16& WaitAndGetTitle() WARN_UNUSED_RESULT; | 269 const base::string16& WaitAndGetTitle() WARN_UNUSED_RESULT; |
| 270 | 270 |
| 271 private: | 271 private: |
| 272 // Overridden WebContentsObserver methods. | 272 // Overridden WebContentsObserver methods. |
| 273 void DidStopLoading(RenderViewHost* render_view_host) override; | 273 void DidStopLoading() override; |
| 274 void TitleWasSet(NavigationEntry* entry, bool explicit_set) override; | 274 void TitleWasSet(NavigationEntry* entry, bool explicit_set) override; |
| 275 | 275 |
| 276 void TestTitle(); | 276 void TestTitle(); |
| 277 | 277 |
| 278 std::vector<base::string16> expected_titles_; | 278 std::vector<base::string16> expected_titles_; |
| 279 scoped_refptr<MessageLoopRunner> message_loop_runner_; | 279 scoped_refptr<MessageLoopRunner> message_loop_runner_; |
| 280 | 280 |
| 281 // The most recently observed expected title, if any. | 281 // The most recently observed expected title, if any. |
| 282 base::string16 observed_title_; | 282 base::string16 observed_title_; |
| 283 | 283 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 WebContents* web_contents_; | 389 WebContents* web_contents_; |
| 390 scoped_ptr<RenderViewCreatedObserver> child_observer_; | 390 scoped_ptr<RenderViewCreatedObserver> child_observer_; |
| 391 scoped_refptr<MessageLoopRunner> runner_; | 391 scoped_refptr<MessageLoopRunner> runner_; |
| 392 | 392 |
| 393 DISALLOW_COPY_AND_ASSIGN(WebContentsAddedObserver); | 393 DISALLOW_COPY_AND_ASSIGN(WebContentsAddedObserver); |
| 394 }; | 394 }; |
| 395 | 395 |
| 396 } // namespace content | 396 } // namespace content |
| 397 | 397 |
| 398 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ | 398 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ |
| OLD | NEW |