| 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> |
| 11 #include <set> | 11 #include <set> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 18 #include "components/test_runner/layout_test_runtime_flags.h" | 18 #include "components/test_runner/layout_test_runtime_flags.h" |
| 19 #include "components/test_runner/test_runner_export.h" | 19 #include "components/test_runner/test_runner_export.h" |
| 20 #include "components/test_runner/web_task.h" | 20 #include "components/test_runner/web_task.h" |
| 21 #include "components/test_runner/web_test_runner.h" | 21 #include "components/test_runner/web_test_runner.h" |
| 22 #include "third_party/WebKit/public/platform/WebImage.h" | |
| 23 #include "v8/include/v8.h" | 22 #include "v8/include/v8.h" |
| 24 | 23 |
| 25 class GURL; | 24 class GURL; |
| 26 class SkBitmap; | 25 class SkBitmap; |
| 27 | 26 |
| 28 namespace blink { | 27 namespace blink { |
| 29 class WebContentSettingsClient; | 28 class WebContentSettingsClient; |
| 30 class WebFrame; | 29 class WebFrame; |
| 31 class WebMediaStream; | 30 class WebMediaStream; |
| 32 class WebString; | 31 class WebString; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 bool UseMockTheme() const { return use_mock_theme_; } | 69 bool UseMockTheme() const { return use_mock_theme_; } |
| 71 | 70 |
| 72 void InvokeCallback(scoped_ptr<InvokeCallbackTask> callback); | 71 void InvokeCallback(scoped_ptr<InvokeCallbackTask> callback); |
| 73 | 72 |
| 74 // WebTestRunner implementation. | 73 // WebTestRunner implementation. |
| 75 bool ShouldGeneratePixelResults() override; | 74 bool ShouldGeneratePixelResults() override; |
| 76 bool ShouldDumpAsAudio() const override; | 75 bool ShouldDumpAsAudio() const override; |
| 77 void GetAudioData(std::vector<unsigned char>* buffer_view) const override; | 76 void GetAudioData(std::vector<unsigned char>* buffer_view) const override; |
| 78 bool IsRecursiveLayoutDumpRequested() override; | 77 bool IsRecursiveLayoutDumpRequested() override; |
| 79 std::string DumpLayout(blink::WebLocalFrame* frame) override; | 78 std::string DumpLayout(blink::WebLocalFrame* frame) override; |
| 80 void DumpPixelsAsync( | |
| 81 blink::WebView* web_view, | |
| 82 const base::Callback<void(const SkBitmap&)>& callback) override; | |
| 83 void ReplicateLayoutTestRuntimeFlagsChanges( | 79 void ReplicateLayoutTestRuntimeFlagsChanges( |
| 84 const base::DictionaryValue& changed_values) override; | 80 const base::DictionaryValue& changed_values) override; |
| 85 bool HasCustomTextDump(std::string* custom_text_dump) const override; | 81 bool HasCustomTextDump(std::string* custom_text_dump) const override; |
| 86 bool ShouldDumpBackForwardList() const override; | 82 bool ShouldDumpBackForwardList() const override; |
| 87 blink::WebContentSettingsClient* GetWebContentSettings() const override; | 83 blink::WebContentSettingsClient* GetWebContentSettings() const override; |
| 88 | 84 |
| 89 // Methods used by WebTestProxyBase and WebFrameTestClient. | 85 // Methods used by WebTestProxyBase and WebFrameTestClient. |
| 90 std::string GetAcceptLanguages() const; | 86 std::string GetAcceptLanguages() const; |
| 91 bool shouldStayOnPageAfterHandlingBeforeUnload() const; | 87 bool shouldStayOnPageAfterHandlingBeforeUnload() const; |
| 92 MockScreenOrientationClient* getMockScreenOrientationClient(); | 88 MockScreenOrientationClient* getMockScreenOrientationClient(); |
| 93 MockWebUserMediaClient* getMockWebUserMediaClient(); | 89 MockWebUserMediaClient* getMockWebUserMediaClient(); |
| 90 bool shouldDumpSelectionRect() const; |
| 94 bool isPrinting() const; | 91 bool isPrinting() const; |
| 95 bool shouldDumpAsTextWithPixelResults(); | 92 bool shouldDumpAsTextWithPixelResults(); |
| 96 bool shouldDumpAsCustomText() const; | 93 bool shouldDumpAsCustomText() const; |
| 97 std:: string customDumpText() const; | 94 std:: string customDumpText() const; |
| 98 void ShowDevTools(const std::string& settings, | 95 void ShowDevTools(const std::string& settings, |
| 99 const std::string& frontend_url); | 96 const std::string& frontend_url); |
| 100 void ClearDevToolsLocalStorage(); | 97 void ClearDevToolsLocalStorage(); |
| 101 void setShouldDumpAsText(bool); | 98 void setShouldDumpAsText(bool); |
| 102 void setShouldDumpAsMarkup(bool); | 99 void setShouldDumpAsMarkup(bool); |
| 103 void setCustomTextOutput(const std::string& text); | 100 void setCustomTextOutput(const std::string& text); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 125 void policyDelegateDone(); | 122 void policyDelegateDone(); |
| 126 bool policyDelegateEnabled() const; | 123 bool policyDelegateEnabled() const; |
| 127 bool policyDelegateIsPermissive() const; | 124 bool policyDelegateIsPermissive() const; |
| 128 bool policyDelegateShouldNotifyDone() const; | 125 bool policyDelegateShouldNotifyDone() const; |
| 129 bool shouldInterceptPostMessage() const; | 126 bool shouldInterceptPostMessage() const; |
| 130 bool shouldDumpResourcePriorities() const; | 127 bool shouldDumpResourcePriorities() const; |
| 131 bool RequestPointerLock(); | 128 bool RequestPointerLock(); |
| 132 void RequestPointerUnlock(); | 129 void RequestPointerUnlock(); |
| 133 bool isPointerLocked(); | 130 bool isPointerLocked(); |
| 134 void setToolTipText(const blink::WebString&); | 131 void setToolTipText(const blink::WebString&); |
| 135 void setDragImage(const blink::WebImage& drag_image); | 132 bool shouldDumpDragImage(); |
| 136 bool shouldDumpNavigationPolicy() const; | 133 bool shouldDumpNavigationPolicy() const; |
| 137 | 134 |
| 138 bool midiAccessorResult(); | 135 bool midiAccessorResult(); |
| 139 | 136 |
| 140 // Methods used by MockColorChooser: | 137 // Methods used by MockColorChooser: |
| 141 void DidOpenChooser(); | 138 void DidOpenChooser(); |
| 142 void DidCloseChooser(); | 139 void DidCloseChooser(); |
| 143 | 140 |
| 144 // A single item in the work queue. | 141 // A single item in the work queue. |
| 145 class WorkItem { | 142 class WorkItem { |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 // changes. It takes no arguments, and ignores any that may be present. | 471 // changes. It takes no arguments, and ignores any that may be present. |
| 475 void DumpResourceRequestPriorities(); | 472 void DumpResourceRequestPriorities(); |
| 476 | 473 |
| 477 // Sets a flag to enable the mock theme. | 474 // Sets a flag to enable the mock theme. |
| 478 void SetUseMockTheme(bool use); | 475 void SetUseMockTheme(bool use); |
| 479 | 476 |
| 480 // Sets a flag that causes the test to be marked as completed when the | 477 // Sets a flag that causes the test to be marked as completed when the |
| 481 // WebFrameClient receives a loadURLExternally() call. | 478 // WebFrameClient receives a loadURLExternally() call. |
| 482 void WaitUntilExternalURLLoad(); | 479 void WaitUntilExternalURLLoad(); |
| 483 | 480 |
| 484 // This function sets a flag to dump the drag image when the next drag&drop is | 481 // This function sets a flag which tells the WebTestProxy to dump the drag |
| 485 // initiated. It is equivalent to DumpAsTextWithPixelResults but the pixel | 482 // image when the next drag-and-drop is initiated. It is equivalent to |
| 486 // results will be the drag image instead of a snapshot of the page. | 483 // DumpAsTextWithPixelResults but the pixel results will be the drag image |
| 484 // instead of a snapshot of the page. |
| 487 void DumpDragImage(); | 485 void DumpDragImage(); |
| 488 | 486 |
| 489 // Sets a flag that tells the WebTestProxy to dump the default navigation | 487 // Sets a flag that tells the WebTestProxy to dump the default navigation |
| 490 // policy passed to the decidePolicyForNavigation callback. | 488 // policy passed to the decidePolicyForNavigation callback. |
| 491 void DumpNavigationPolicy(); | 489 void DumpNavigationPolicy(); |
| 492 | 490 |
| 493 // Dump current PageImportanceSignals for the page. | 491 // Dump current PageImportanceSignals for the page. |
| 494 void DumpPageImportanceSignals(); | 492 void DumpPageImportanceSignals(); |
| 495 | 493 |
| 496 /////////////////////////////////////////////////////////////////////////// | 494 /////////////////////////////////////////////////////////////////////////// |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 750 bool dump_window_status_changes_; | 748 bool dump_window_status_changes_; |
| 751 | 749 |
| 752 // If true, the test_shell will output descriptive test for spellcheck | 750 // If true, the test_shell will output descriptive test for spellcheck |
| 753 // execution. | 751 // execution. |
| 754 bool dump_spell_check_callbacks_; | 752 bool dump_spell_check_callbacks_; |
| 755 | 753 |
| 756 // If true, the test_shell will produce a dump of the back forward list as | 754 // If true, the test_shell will produce a dump of the back forward list as |
| 757 // well. | 755 // well. |
| 758 bool dump_back_forward_list_; | 756 bool dump_back_forward_list_; |
| 759 | 757 |
| 758 // If true, the test_shell will draw the bounds of the current selection rect |
| 759 // taking possible transforms of the selection rect into account. |
| 760 bool dump_selection_rect_; |
| 761 |
| 762 // If true, the test_shell will dump the drag image as pixel results. |
| 763 bool dump_drag_image_; |
| 764 |
| 760 // If true, content_shell will dump the default navigation policy passed to | 765 // If true, content_shell will dump the default navigation policy passed to |
| 761 // WebFrameClient::decidePolicyForNavigation. | 766 // WebFrameClient::decidePolicyForNavigation. |
| 762 bool dump_navigation_policy_; | 767 bool dump_navigation_policy_; |
| 763 | 768 |
| 764 // If true, pixel dump will be produced as a series of 1px-tall, view-wide | 769 // If true, pixel dump will be produced as a series of 1px-tall, view-wide |
| 765 // individual paints over the height of the view. | 770 // individual paints over the height of the view. |
| 766 bool test_repaint_; | 771 bool test_repaint_; |
| 767 | 772 |
| 768 // If true and test_repaint_ is true as well, pixel dump will be produced as | 773 // If true and test_repaint_ is true as well, pixel dump will be produced as |
| 769 // a series of 1px-wide, view-tall paints across the width of the view. | 774 // a series of 1px-wide, view-tall paints across the width of the view. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 PointerLockWillFailSync, | 810 PointerLockWillFailSync, |
| 806 } pointer_lock_planned_result_; | 811 } pointer_lock_planned_result_; |
| 807 bool use_mock_theme_; | 812 bool use_mock_theme_; |
| 808 | 813 |
| 809 scoped_ptr<MockScreenOrientationClient> mock_screen_orientation_client_; | 814 scoped_ptr<MockScreenOrientationClient> mock_screen_orientation_client_; |
| 810 scoped_ptr<MockWebUserMediaClient> user_media_client_; | 815 scoped_ptr<MockWebUserMediaClient> user_media_client_; |
| 811 | 816 |
| 812 // Number of currently active color choosers. | 817 // Number of currently active color choosers. |
| 813 int chooser_count_; | 818 int chooser_count_; |
| 814 | 819 |
| 815 // Captured drag image. | |
| 816 blink::WebImage drag_image_; | |
| 817 | |
| 818 base::WeakPtrFactory<TestRunner> weak_factory_; | 820 base::WeakPtrFactory<TestRunner> weak_factory_; |
| 819 | 821 |
| 820 DISALLOW_COPY_AND_ASSIGN(TestRunner); | 822 DISALLOW_COPY_AND_ASSIGN(TestRunner); |
| 821 }; | 823 }; |
| 822 | 824 |
| 823 } // namespace test_runner | 825 } // namespace test_runner |
| 824 | 826 |
| 825 #endif // COMPONENTS_TEST_RUNNER_TEST_RUNNER_H_ | 827 #endif // COMPONENTS_TEST_RUNNER_TEST_RUNNER_H_ |
| OLD | NEW |