OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_TEST_RUNNER_TEST_RUNNER_H_ | 5 #ifndef COMPONENTS_TEST_RUNNER_TEST_RUNNER_H_ |
6 #define COMPONENTS_TEST_RUNNER_TEST_RUNNER_H_ | 6 #define COMPONENTS_TEST_RUNNER_TEST_RUNNER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <deque> | 10 #include <deque> |
(...skipping 18 matching lines...) Expand all Loading... |
29 namespace base { | 29 namespace base { |
30 class NullableString16; | 30 class NullableString16; |
31 } | 31 } |
32 | 32 |
33 namespace blink { | 33 namespace blink { |
34 class WebContentSettingsClient; | 34 class WebContentSettingsClient; |
35 class WebFrame; | 35 class WebFrame; |
36 class WebLocalFrame; | 36 class WebLocalFrame; |
37 class WebString; | 37 class WebString; |
38 class WebView; | 38 class WebView; |
39 class WebWidget; | |
40 } | 39 } |
41 | 40 |
42 namespace gin { | 41 namespace gin { |
43 class ArrayBufferView; | 42 class ArrayBufferView; |
44 class Arguments; | 43 class Arguments; |
45 } | 44 } |
46 | 45 |
47 namespace test_runner { | 46 namespace test_runner { |
48 | 47 |
49 class MockContentSettingsClient; | 48 class MockContentSettingsClient; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 const base::DictionaryValue& changed_values) override; | 99 const base::DictionaryValue& changed_values) override; |
101 bool HasCustomTextDump(std::string* custom_text_dump) const override; | 100 bool HasCustomTextDump(std::string* custom_text_dump) const override; |
102 bool ShouldDumpBackForwardList() const override; | 101 bool ShouldDumpBackForwardList() const override; |
103 blink::WebContentSettingsClient* GetWebContentSettings() const override; | 102 blink::WebContentSettingsClient* GetWebContentSettings() const override; |
104 void InitializeWebViewWithMocks(blink::WebView* web_view) override; | 103 void InitializeWebViewWithMocks(blink::WebView* web_view) override; |
105 void SetFocus(blink::WebView* web_view, bool focus) override; | 104 void SetFocus(blink::WebView* web_view, bool focus) override; |
106 | 105 |
107 // Methods used by WebViewTestClient and WebFrameTestClient. | 106 // Methods used by WebViewTestClient and WebFrameTestClient. |
108 void OnNavigationBegin(blink::WebFrame* frame); | 107 void OnNavigationBegin(blink::WebFrame* frame); |
109 void OnNavigationEnd() { will_navigate_ = false; } | 108 void OnNavigationEnd() { will_navigate_ = false; } |
110 void OnAnimationScheduled(blink::WebWidget* widget); | |
111 void OnAnimationBegun(blink::WebWidget* widget); | |
112 std::string GetAcceptLanguages() const; | 109 std::string GetAcceptLanguages() const; |
113 bool shouldStayOnPageAfterHandlingBeforeUnload() const; | 110 bool shouldStayOnPageAfterHandlingBeforeUnload() const; |
114 MockScreenOrientationClient* getMockScreenOrientationClient(); | 111 MockScreenOrientationClient* getMockScreenOrientationClient(); |
115 MockWebUserMediaClient* getMockWebUserMediaClient(); | 112 MockWebUserMediaClient* getMockWebUserMediaClient(); |
116 MockWebSpeechRecognizer* getMockWebSpeechRecognizer(); | 113 MockWebSpeechRecognizer* getMockWebSpeechRecognizer(); |
117 bool isPrinting() const; | 114 bool isPrinting() const; |
118 bool shouldDumpAsCustomText() const; | 115 bool shouldDumpAsCustomText() const; |
119 std:: string customDumpText() const; | 116 std:: string customDumpText() const; |
120 void ShowDevTools(const std::string& settings, | 117 void ShowDevTools(const std::string& settings, |
121 const std::string& frontend_url); | 118 const std::string& frontend_url); |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 void SetAllowUniversalAccessFromFileURLs(bool allow); | 319 void SetAllowUniversalAccessFromFileURLs(bool allow); |
323 void SetAllowFileAccessFromFileURLs(bool allow); | 320 void SetAllowFileAccessFromFileURLs(bool allow); |
324 void OverridePreference(const std::string& key, v8::Local<v8::Value> value); | 321 void OverridePreference(const std::string& key, v8::Local<v8::Value> value); |
325 | 322 |
326 // Modify accept_languages in RendererPreferences. | 323 // Modify accept_languages in RendererPreferences. |
327 void SetAcceptLanguages(const std::string& accept_languages); | 324 void SetAcceptLanguages(const std::string& accept_languages); |
328 | 325 |
329 // Enable or disable plugins. | 326 // Enable or disable plugins. |
330 void SetPluginsEnabled(bool enabled); | 327 void SetPluginsEnabled(bool enabled); |
331 | 328 |
332 // Returns |true| if an animation has been scheduled in one or more WebViews | |
333 // participating in the layout test. | |
334 bool GetAnimationScheduled() const; | |
335 | |
336 /////////////////////////////////////////////////////////////////////////// | 329 /////////////////////////////////////////////////////////////////////////// |
337 // Methods that modify the state of TestRunner | 330 // Methods that modify the state of TestRunner |
338 | 331 |
339 // This function sets a flag that tells the test_shell to print a line of | 332 // This function sets a flag that tells the test_shell to print a line of |
340 // descriptive text for each editing command. It takes no arguments, and | 333 // descriptive text for each editing command. It takes no arguments, and |
341 // ignores any that may be present. | 334 // ignores any that may be present. |
342 void DumpEditingCallbacks(); | 335 void DumpEditingCallbacks(); |
343 | 336 |
344 // This function sets a flag that tells the test_shell to dump pages as | 337 // This function sets a flag that tells the test_shell to dump pages as |
345 // plain text, rather than as a text representation of the renderer's state. | 338 // plain text, rather than as a text representation of the renderer's state. |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 int chooser_count_; | 644 int chooser_count_; |
652 | 645 |
653 // Captured drag image. | 646 // Captured drag image. |
654 blink::WebImage drag_image_; | 647 blink::WebImage drag_image_; |
655 | 648 |
656 // View that was focused by a previous call to TestRunner::SetFocus method. | 649 // View that was focused by a previous call to TestRunner::SetFocus method. |
657 // Note - this can be a dangling pointer to an already destroyed WebView (this | 650 // Note - this can be a dangling pointer to an already destroyed WebView (this |
658 // is ok, because this is taken care of in WebTestDelegate::SetFocus). | 651 // is ok, because this is taken care of in WebTestDelegate::SetFocus). |
659 blink::WebView* previously_focused_view_; | 652 blink::WebView* previously_focused_view_; |
660 | 653 |
661 std::set<blink::WebWidget*> widgets_with_scheduled_animations_; | |
662 | |
663 // True if we run a test in LayoutTests/imported/{csswg-test,wpt}/. | 654 // True if we run a test in LayoutTests/imported/{csswg-test,wpt}/. |
664 bool is_web_platform_tests_mode_; | 655 bool is_web_platform_tests_mode_; |
665 | 656 |
666 // An effective connection type settable by layout tests. | 657 // An effective connection type settable by layout tests. |
667 blink::WebEffectiveConnectionType effective_connection_type_; | 658 blink::WebEffectiveConnectionType effective_connection_type_; |
668 | 659 |
669 base::WeakPtrFactory<TestRunner> weak_factory_; | 660 base::WeakPtrFactory<TestRunner> weak_factory_; |
670 | 661 |
671 DISALLOW_COPY_AND_ASSIGN(TestRunner); | 662 DISALLOW_COPY_AND_ASSIGN(TestRunner); |
672 }; | 663 }; |
673 | 664 |
674 } // namespace test_runner | 665 } // namespace test_runner |
675 | 666 |
676 #endif // COMPONENTS_TEST_RUNNER_TEST_RUNNER_H_ | 667 #endif // COMPONENTS_TEST_RUNNER_TEST_RUNNER_H_ |
OLD | NEW |