Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(486)

Side by Side Diff: components/test_runner/test_runner.h

Issue 1840823002: Extract WebViewClient implementation out of WebTestProxyBase. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@separate-pixel-dump-code
Patch Set: Expanding a comment + an IWYU fix. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/test_runner/event_sender.cc ('k') | components/test_runner/test_runner.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 25 matching lines...) Expand all
36 36
37 namespace gin { 37 namespace gin {
38 class ArrayBufferView; 38 class ArrayBufferView;
39 class Arguments; 39 class Arguments;
40 } 40 }
41 41
42 namespace test_runner { 42 namespace test_runner {
43 43
44 class InvokeCallbackTask; 44 class InvokeCallbackTask;
45 class MockScreenOrientationClient; 45 class MockScreenOrientationClient;
46 class MockWebSpeechRecognizer;
46 class MockWebUserMediaClient; 47 class MockWebUserMediaClient;
47 class TestInterfaces; 48 class TestInterfaces;
48 class WebContentSettings; 49 class WebContentSettings;
49 class WebTestDelegate; 50 class WebTestDelegate;
50 class WebTestProxyBase; 51 class WebTestProxyBase;
51 52
52 class TestRunner : public WebTestRunner, 53 class TestRunner : public WebTestRunner,
53 public base::SupportsWeakPtr<TestRunner> { 54 public base::SupportsWeakPtr<TestRunner> {
54 public: 55 public:
55 explicit TestRunner(TestInterfaces*); 56 explicit TestRunner(TestInterfaces*);
(...skipping 23 matching lines...) Expand all
79 std::string DumpLayout(blink::WebLocalFrame* frame) override; 80 std::string DumpLayout(blink::WebLocalFrame* frame) override;
80 void DumpPixelsAsync( 81 void DumpPixelsAsync(
81 blink::WebView* web_view, 82 blink::WebView* web_view,
82 const base::Callback<void(const SkBitmap&)>& callback) override; 83 const base::Callback<void(const SkBitmap&)>& callback) override;
83 void ReplicateLayoutTestRuntimeFlagsChanges( 84 void ReplicateLayoutTestRuntimeFlagsChanges(
84 const base::DictionaryValue& changed_values) override; 85 const base::DictionaryValue& changed_values) override;
85 bool HasCustomTextDump(std::string* custom_text_dump) const override; 86 bool HasCustomTextDump(std::string* custom_text_dump) const override;
86 bool ShouldDumpBackForwardList() const override; 87 bool ShouldDumpBackForwardList() const override;
87 blink::WebContentSettingsClient* GetWebContentSettings() const override; 88 blink::WebContentSettingsClient* GetWebContentSettings() const override;
88 89
89 // Methods used by WebTestProxyBase and WebFrameTestClient. 90 // Methods used by WebViewTestClient and WebFrameTestClient.
91 void OnAnimationScheduled(blink::WebView* view);
92 void OnAnimationBegun(blink::WebView* view);
90 std::string GetAcceptLanguages() const; 93 std::string GetAcceptLanguages() const;
91 bool shouldStayOnPageAfterHandlingBeforeUnload() const; 94 bool shouldStayOnPageAfterHandlingBeforeUnload() const;
92 MockScreenOrientationClient* getMockScreenOrientationClient(); 95 MockScreenOrientationClient* getMockScreenOrientationClient();
93 MockWebUserMediaClient* getMockWebUserMediaClient(); 96 MockWebUserMediaClient* getMockWebUserMediaClient();
97 MockWebSpeechRecognizer* getMockWebSpeechRecognizer();
94 bool isPrinting() const; 98 bool isPrinting() const;
95 bool shouldDumpAsTextWithPixelResults(); 99 bool shouldDumpAsTextWithPixelResults();
96 bool shouldDumpAsCustomText() const; 100 bool shouldDumpAsCustomText() const;
97 std:: string customDumpText() const; 101 std:: string customDumpText() const;
98 void ShowDevTools(const std::string& settings, 102 void ShowDevTools(const std::string& settings,
99 const std::string& frontend_url); 103 const std::string& frontend_url);
100 void ClearDevToolsLocalStorage(); 104 void ClearDevToolsLocalStorage();
101 void setShouldDumpAsText(bool); 105 void setShouldDumpAsText(bool);
102 void setShouldDumpAsMarkup(bool); 106 void setShouldDumpAsMarkup(bool);
103 void setCustomTextOutput(const std::string& text); 107 void setCustomTextOutput(const std::string& text);
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 void SetAllowUniversalAccessFromFileURLs(bool allow); 345 void SetAllowUniversalAccessFromFileURLs(bool allow);
342 void SetAllowFileAccessFromFileURLs(bool allow); 346 void SetAllowFileAccessFromFileURLs(bool allow);
343 void OverridePreference(const std::string& key, v8::Local<v8::Value> value); 347 void OverridePreference(const std::string& key, v8::Local<v8::Value> value);
344 348
345 // Modify accept_languages in RendererPreferences. 349 // Modify accept_languages in RendererPreferences.
346 void SetAcceptLanguages(const std::string& accept_languages); 350 void SetAcceptLanguages(const std::string& accept_languages);
347 351
348 // Enable or disable plugins. 352 // Enable or disable plugins.
349 void SetPluginsEnabled(bool enabled); 353 void SetPluginsEnabled(bool enabled);
350 354
351 bool AnimationScheduled(); 355 // Returns |true| if an animation has been scheduled in one or more WebViews
356 // participating in the layout test.
357 bool GetAnimationScheduled() const;
352 358
353 /////////////////////////////////////////////////////////////////////////// 359 ///////////////////////////////////////////////////////////////////////////
354 // Methods that modify the state of TestRunner 360 // Methods that modify the state of TestRunner
355 361
356 // This function sets a flag that tells the test_shell to print a line of 362 // This function sets a flag that tells the test_shell to print a line of
357 // descriptive text for each editing command. It takes no arguments, and 363 // descriptive text for each editing command. It takes no arguments, and
358 // ignores any that may be present. 364 // ignores any that may be present.
359 void DumpEditingCallbacks(); 365 void DumpEditingCallbacks();
360 366
361 // This function sets a flag that tells the test_shell to dump pages as 367 // This function sets a flag that tells the test_shell to dump pages as
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 807
802 bool pointer_locked_; 808 bool pointer_locked_;
803 enum { 809 enum {
804 PointerLockWillSucceed, 810 PointerLockWillSucceed,
805 PointerLockWillRespondAsync, 811 PointerLockWillRespondAsync,
806 PointerLockWillFailSync, 812 PointerLockWillFailSync,
807 } pointer_lock_planned_result_; 813 } pointer_lock_planned_result_;
808 bool use_mock_theme_; 814 bool use_mock_theme_;
809 815
810 scoped_ptr<MockScreenOrientationClient> mock_screen_orientation_client_; 816 scoped_ptr<MockScreenOrientationClient> mock_screen_orientation_client_;
817 scoped_ptr<MockWebSpeechRecognizer> speech_recognizer_;
811 scoped_ptr<MockWebUserMediaClient> user_media_client_; 818 scoped_ptr<MockWebUserMediaClient> user_media_client_;
812 819
813 // Number of currently active color choosers. 820 // Number of currently active color choosers.
814 int chooser_count_; 821 int chooser_count_;
815 822
816 // Captured drag image. 823 // Captured drag image.
817 blink::WebImage drag_image_; 824 blink::WebImage drag_image_;
818 825
826 std::set<blink::WebView*> views_with_scheduled_animations_;
827
819 base::WeakPtrFactory<TestRunner> weak_factory_; 828 base::WeakPtrFactory<TestRunner> weak_factory_;
820 829
821 DISALLOW_COPY_AND_ASSIGN(TestRunner); 830 DISALLOW_COPY_AND_ASSIGN(TestRunner);
822 }; 831 };
823 832
824 } // namespace test_runner 833 } // namespace test_runner
825 834
826 #endif // COMPONENTS_TEST_RUNNER_TEST_RUNNER_H_ 835 #endif // COMPONENTS_TEST_RUNNER_TEST_RUNNER_H_
OLDNEW
« no previous file with comments | « components/test_runner/event_sender.cc ('k') | components/test_runner/test_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698