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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 bool UseMockTheme() const { return use_mock_theme_; } | 67 bool UseMockTheme() const { return use_mock_theme_; } |
68 | 68 |
69 void InvokeCallback(scoped_ptr<InvokeCallbackTask> callback); | 69 void InvokeCallback(scoped_ptr<InvokeCallbackTask> callback); |
70 | 70 |
71 // WebTestRunner implementation. | 71 // WebTestRunner implementation. |
72 bool ShouldGeneratePixelResults() override; | 72 bool ShouldGeneratePixelResults() override; |
73 bool ShouldStayOnPageAfterHandlingBeforeUnload() const override; | 73 bool ShouldStayOnPageAfterHandlingBeforeUnload() const override; |
74 bool ShouldDumpAsAudio() const override; | 74 bool ShouldDumpAsAudio() const override; |
75 void GetAudioData(std::vector<unsigned char>* buffer_view) const override; | 75 void GetAudioData(std::vector<unsigned char>* buffer_view) const override; |
76 const LayoutDumpFlags& GetLayoutDumpFlags() override; | 76 const LayoutDumpFlags& GetLayoutDumpFlags() override; |
| 77 void ReplicateLayoutDumpFlagsChanges( |
| 78 const base::DictionaryValue& changed_values) override; |
77 bool HasCustomTextDump(std::string* custom_text_dump) const override; | 79 bool HasCustomTextDump(std::string* custom_text_dump) const override; |
78 bool ShouldDumpBackForwardList() const override; | 80 bool ShouldDumpBackForwardList() const override; |
79 blink::WebContentSettingsClient* GetWebContentSettings() const override; | 81 blink::WebContentSettingsClient* GetWebContentSettings() const override; |
80 | 82 |
81 // Methods used by WebTestProxyBase. | 83 // Methods used by WebTestProxyBase. |
82 bool shouldDumpSelectionRect() const; | 84 bool shouldDumpSelectionRect() const; |
83 bool isPrinting() const; | 85 bool isPrinting() const; |
84 bool shouldDumpAsTextWithPixelResults(); | 86 bool shouldDumpAsTextWithPixelResults(); |
85 bool shouldDumpAsCustomText() const; | 87 bool shouldDumpAsCustomText() const; |
86 std:: string customDumpText() const; | 88 std:: string customDumpText() const; |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 void CapturePixelsAsyncThen(v8::Local<v8::Function> callback); | 617 void CapturePixelsAsyncThen(v8::Local<v8::Function> callback); |
616 // Similar to CapturePixelsAsyncThen(). Copies to the clipboard the image | 618 // Similar to CapturePixelsAsyncThen(). Copies to the clipboard the image |
617 // located at a particular point in the WebView (if there is such an image), | 619 // located at a particular point in the WebView (if there is such an image), |
618 // reads back its pixels, and provides the snapshot to the callback. If there | 620 // reads back its pixels, and provides the snapshot to the callback. If there |
619 // is no image at that point, calls the callback with (0, 0, empty_snapshot). | 621 // is no image at that point, calls the callback with (0, 0, empty_snapshot). |
620 void CopyImageAtAndCapturePixelsAsyncThen( | 622 void CopyImageAtAndCapturePixelsAsyncThen( |
621 int x, int y, const v8::Local<v8::Function> callback); | 623 int x, int y, const v8::Local<v8::Function> callback); |
622 | 624 |
623 void GetManifestThen(v8::Local<v8::Function> callback); | 625 void GetManifestThen(v8::Local<v8::Function> callback); |
624 | 626 |
| 627 // Takes care of notifying the delegate after a change to layout dump flags. |
| 628 void OnLayoutDumpFlagsChanged(); |
| 629 |
625 /////////////////////////////////////////////////////////////////////////// | 630 /////////////////////////////////////////////////////////////////////////// |
626 // Internal helpers | 631 // Internal helpers |
627 | 632 |
628 void GetManifestCallback(scoped_ptr<InvokeCallbackTask> task, | 633 void GetManifestCallback(scoped_ptr<InvokeCallbackTask> task, |
629 const blink::WebURLResponse& response, | 634 const blink::WebURLResponse& response, |
630 const std::string& data); | 635 const std::string& data); |
631 void CapturePixelsCallback(scoped_ptr<InvokeCallbackTask> task, | 636 void CapturePixelsCallback(scoped_ptr<InvokeCallbackTask> task, |
632 const SkBitmap& snapshot); | 637 const SkBitmap& snapshot); |
633 void DispatchBeforeInstallPromptCallback(scoped_ptr<InvokeCallbackTask> task, | 638 void DispatchBeforeInstallPromptCallback(scoped_ptr<InvokeCallbackTask> task, |
634 bool canceled); | 639 bool canceled); |
(...skipping 19 matching lines...) Expand all Loading... |
654 // Sets a flag causing the next call to DrawingBuffer::create to fail. | 659 // Sets a flag causing the next call to DrawingBuffer::create to fail. |
655 void ForceNextDrawingBufferCreationToFail(); | 660 void ForceNextDrawingBufferCreationToFail(); |
656 | 661 |
657 bool test_is_running_; | 662 bool test_is_running_; |
658 | 663 |
659 // When reset is called, go through and close all but the main test shell | 664 // When reset is called, go through and close all but the main test shell |
660 // window. By default, set to true but toggled to false using | 665 // window. By default, set to true but toggled to false using |
661 // setCloseRemainingWindowsWhenComplete(). | 666 // setCloseRemainingWindowsWhenComplete(). |
662 bool close_remaining_windows_; | 667 bool close_remaining_windows_; |
663 | 668 |
664 // If true, don't dump output until notifyDone is called. | |
665 bool wait_until_done_; | |
666 | |
667 // If true, ends the test when a URL is loaded externally via | 669 // If true, ends the test when a URL is loaded externally via |
668 // WebFrameClient::loadURLExternally(). | 670 // WebFrameClient::loadURLExternally(). |
669 bool wait_until_external_url_load_; | 671 bool wait_until_external_url_load_; |
670 | 672 |
671 // Causes navigation actions just printout the intended navigation instead | 673 // Causes navigation actions just printout the intended navigation instead |
672 // of taking you to the page. This is used for cases like mailto, where you | 674 // of taking you to the page. This is used for cases like mailto, where you |
673 // don't actually want to open the mail program. | 675 // don't actually want to open the mail program. |
674 bool policy_delegate_enabled_; | 676 bool policy_delegate_enabled_; |
675 | 677 |
676 // Toggles the behavior of the policy delegate. If true, then navigations | 678 // Toggles the behavior of the policy delegate. If true, then navigations |
(...skipping 20 matching lines...) Expand all Loading... |
697 // Bound variable counting the number of top URLs visited. | 699 // Bound variable counting the number of top URLs visited. |
698 int web_history_item_count_; | 700 int web_history_item_count_; |
699 | 701 |
700 // Bound variable to set whether postMessages should be intercepted or not | 702 // Bound variable to set whether postMessages should be intercepted or not |
701 bool intercept_post_message_; | 703 bool intercept_post_message_; |
702 | 704 |
703 // If true, the test_shell will write a descriptive line for each editing | 705 // If true, the test_shell will write a descriptive line for each editing |
704 // command. | 706 // command. |
705 bool dump_editting_callbacks_; | 707 bool dump_editting_callbacks_; |
706 | 708 |
707 // If true, the test_shell will generate pixel results in DumpAsText mode | |
708 bool generate_pixel_results_; | |
709 | |
710 // Flags controlling what content gets dumped as a layout text result. | 709 // Flags controlling what content gets dumped as a layout text result. |
711 LayoutDumpFlags layout_dump_flags_; | 710 LayoutDumpFlags layout_dump_flags_; |
712 | 711 |
713 // If true, the test_shell will print out the icon change notifications. | 712 // If true, the test_shell will print out the icon change notifications. |
714 bool dump_icon_changes_; | 713 bool dump_icon_changes_; |
715 | 714 |
716 // If true, the test_shell will output a base64 encoded WAVE file. | 715 // If true, the test_shell will output a base64 encoded WAVE file. |
717 bool dump_as_audio_; | 716 bool dump_as_audio_; |
718 | 717 |
719 // If true, the test_shell will output a descriptive line for each frame | 718 // If true, the test_shell will output a descriptive line for each frame |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
820 bool use_mock_theme_; | 819 bool use_mock_theme_; |
821 | 820 |
822 base::WeakPtrFactory<TestRunner> weak_factory_; | 821 base::WeakPtrFactory<TestRunner> weak_factory_; |
823 | 822 |
824 DISALLOW_COPY_AND_ASSIGN(TestRunner); | 823 DISALLOW_COPY_AND_ASSIGN(TestRunner); |
825 }; | 824 }; |
826 | 825 |
827 } // namespace test_runner | 826 } // namespace test_runner |
828 | 827 |
829 #endif // COMPONENTS_TEST_RUNNER_TEST_RUNNER_H_ | 828 #endif // COMPONENTS_TEST_RUNNER_TEST_RUNNER_H_ |
OLD | NEW |