| 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> |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "base/files/scoped_temp_dir.h" | 14 #include "base/files/scoped_temp_dir.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 17 #include "base/process/process.h" | 17 #include "base/process/process.h" |
| 18 #include "base/run_loop.h" |
| 18 #include "base/strings/string16.h" | 19 #include "base/strings/string16.h" |
| 19 #include "build/build_config.h" | 20 #include "build/build_config.h" |
| 20 #include "cc/output/compositor_frame.h" | 21 #include "cc/output/compositor_frame.h" |
| 21 #include "content/public/browser/browser_message_filter.h" | 22 #include "content/public/browser/browser_message_filter.h" |
| 22 #include "content/public/browser/notification_observer.h" | 23 #include "content/public/browser/notification_observer.h" |
| 23 #include "content/public/browser/notification_registrar.h" | 24 #include "content/public/browser/notification_registrar.h" |
| 24 #include "content/public/browser/render_process_host_observer.h" | 25 #include "content/public/browser/render_process_host_observer.h" |
| 25 #include "content/public/browser/web_contents_delegate.h" | 26 #include "content/public/browser/web_contents_delegate.h" |
| 26 #include "content/public/browser/web_contents_observer.h" | 27 #include "content/public/browser/web_contents_observer.h" |
| 27 #include "content/public/common/page_type.h" | 28 #include "content/public/common/page_type.h" |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 const base::string16& WaitAndGetTitle() WARN_UNUSED_RESULT; | 368 const base::string16& WaitAndGetTitle() WARN_UNUSED_RESULT; |
| 368 | 369 |
| 369 private: | 370 private: |
| 370 // Overridden WebContentsObserver methods. | 371 // Overridden WebContentsObserver methods. |
| 371 void DidStopLoading() override; | 372 void DidStopLoading() override; |
| 372 void TitleWasSet(NavigationEntry* entry, bool explicit_set) override; | 373 void TitleWasSet(NavigationEntry* entry, bool explicit_set) override; |
| 373 | 374 |
| 374 void TestTitle(); | 375 void TestTitle(); |
| 375 | 376 |
| 376 std::vector<base::string16> expected_titles_; | 377 std::vector<base::string16> expected_titles_; |
| 377 scoped_refptr<MessageLoopRunner> message_loop_runner_; | 378 base::RunLoop run_loop_; |
| 378 | 379 |
| 379 // The most recently observed expected title, if any. | 380 // The most recently observed expected title, if any. |
| 380 base::string16 observed_title_; | 381 base::string16 observed_title_; |
| 381 | 382 |
| 382 DISALLOW_COPY_AND_ASSIGN(TitleWatcher); | 383 DISALLOW_COPY_AND_ASSIGN(TitleWatcher); |
| 383 }; | 384 }; |
| 384 | 385 |
| 385 // Watches a RenderProcessHost and waits for specified destruction events. | 386 // Watches a RenderProcessHost and waits for specified destruction events. |
| 386 class RenderProcessHostWatcher : public RenderProcessHostObserver { | 387 class RenderProcessHostWatcher : public RenderProcessHostObserver { |
| 387 public: | 388 public: |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 756 | 757 |
| 757 private: | 758 private: |
| 758 PwnMessageHelper(); // Not instantiable. | 759 PwnMessageHelper(); // Not instantiable. |
| 759 | 760 |
| 760 DISALLOW_COPY_AND_ASSIGN(PwnMessageHelper); | 761 DISALLOW_COPY_AND_ASSIGN(PwnMessageHelper); |
| 761 }; | 762 }; |
| 762 | 763 |
| 763 } // namespace content | 764 } // namespace content |
| 764 | 765 |
| 765 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ | 766 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ |
| OLD | NEW |