| 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_dump_flags.h" |
| 18 #include "components/test_runner/test_runner_export.h" | 19 #include "components/test_runner/test_runner_export.h" |
| 19 #include "components/test_runner/web_task.h" | 20 #include "components/test_runner/web_task.h" |
| 20 #include "components/test_runner/web_test_runner.h" | 21 #include "components/test_runner/web_test_runner.h" |
| 21 #include "v8/include/v8.h" | 22 #include "v8/include/v8.h" |
| 22 | 23 |
| 23 class GURL; | 24 class GURL; |
| 24 class SkBitmap; | 25 class SkBitmap; |
| 25 | 26 |
| 26 namespace blink { | 27 namespace blink { |
| 27 class WebContentSettingsClient; | 28 class WebContentSettingsClient; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 66 |
| 66 bool UseMockTheme() const { return use_mock_theme_; } | 67 bool UseMockTheme() const { return use_mock_theme_; } |
| 67 | 68 |
| 68 void InvokeCallback(scoped_ptr<InvokeCallbackTask> callback); | 69 void InvokeCallback(scoped_ptr<InvokeCallbackTask> callback); |
| 69 | 70 |
| 70 // WebTestRunner implementation. | 71 // WebTestRunner implementation. |
| 71 bool ShouldGeneratePixelResults() override; | 72 bool ShouldGeneratePixelResults() override; |
| 72 bool ShouldStayOnPageAfterHandlingBeforeUnload() const override; | 73 bool ShouldStayOnPageAfterHandlingBeforeUnload() const override; |
| 73 bool ShouldDumpAsAudio() const override; | 74 bool ShouldDumpAsAudio() const override; |
| 74 void GetAudioData(std::vector<unsigned char>* buffer_view) const override; | 75 void GetAudioData(std::vector<unsigned char>* buffer_view) const override; |
| 75 LayoutDumpFlags GetLayoutDumpFlags() override; | 76 const LayoutDumpFlags& GetLayoutDumpFlags() override; |
| 76 bool HasCustomTextDump(std::string* custom_text_dump) const override; | 77 bool HasCustomTextDump(std::string* custom_text_dump) const override; |
| 77 bool ShouldDumpBackForwardList() const override; | 78 bool ShouldDumpBackForwardList() const override; |
| 78 blink::WebContentSettingsClient* GetWebContentSettings() const override; | 79 blink::WebContentSettingsClient* GetWebContentSettings() const override; |
| 79 | 80 |
| 80 // Methods used by WebTestProxyBase. | 81 // Methods used by WebTestProxyBase. |
| 81 bool shouldDumpSelectionRect() const; | 82 bool shouldDumpSelectionRect() const; |
| 82 bool isPrinting() const; | 83 bool isPrinting() const; |
| 83 bool shouldDumpAsText(); | |
| 84 bool shouldDumpAsTextWithPixelResults(); | 84 bool shouldDumpAsTextWithPixelResults(); |
| 85 bool shouldDumpAsCustomText() const; | 85 bool shouldDumpAsCustomText() const; |
| 86 std:: string customDumpText() const; | 86 std:: string customDumpText() const; |
| 87 bool shouldDumpAsMarkup(); | |
| 88 bool shouldDumpChildFrameScrollPositions() const; | |
| 89 bool shouldDumpChildFramesAsMarkup() const; | |
| 90 bool shouldDumpChildFramesAsText() const; | |
| 91 void ShowDevTools(const std::string& settings, | 87 void ShowDevTools(const std::string& settings, |
| 92 const std::string& frontend_url); | 88 const std::string& frontend_url); |
| 93 void ClearDevToolsLocalStorage(); | 89 void ClearDevToolsLocalStorage(); |
| 94 void setShouldDumpAsText(bool); | 90 void setShouldDumpAsText(bool); |
| 95 void setShouldDumpAsMarkup(bool); | 91 void setShouldDumpAsMarkup(bool); |
| 96 void setCustomTextOutput(const std::string& text); | 92 void setCustomTextOutput(const std::string& text); |
| 97 void setShouldGeneratePixelResults(bool); | 93 void setShouldGeneratePixelResults(bool); |
| 98 void setShouldDumpFrameLoadCallbacks(bool); | 94 void setShouldDumpFrameLoadCallbacks(bool); |
| 99 void setShouldDumpPingLoaderCallbacks(bool); | 95 void setShouldDumpPingLoaderCallbacks(bool); |
| 100 void setShouldEnableViewSource(bool); | 96 void setShouldEnableViewSource(bool); |
| (...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 // Bound variable to set whether postMessages should be intercepted or not | 704 // Bound variable to set whether postMessages should be intercepted or not |
| 709 bool intercept_post_message_; | 705 bool intercept_post_message_; |
| 710 | 706 |
| 711 // If true, the test_shell will write a descriptive line for each editing | 707 // If true, the test_shell will write a descriptive line for each editing |
| 712 // command. | 708 // command. |
| 713 bool dump_editting_callbacks_; | 709 bool dump_editting_callbacks_; |
| 714 | 710 |
| 715 // If true, the test_shell will generate pixel results in DumpAsText mode | 711 // If true, the test_shell will generate pixel results in DumpAsText mode |
| 716 bool generate_pixel_results_; | 712 bool generate_pixel_results_; |
| 717 | 713 |
| 718 // If true, the test_shell will produce a plain text dump rather than a | 714 // Flags controlling what content gets dumped as a layout text result. |
| 719 // text representation of the renderer. | 715 LayoutDumpFlags layout_dump_flags_; |
| 720 bool dump_as_text_; | |
| 721 | |
| 722 // If true and if dump_as_text_ is true, the test_shell will recursively | |
| 723 // dump all frames as plain text. | |
| 724 bool dump_child_frames_as_text_; | |
| 725 | |
| 726 // If true, the test_shell will produce a dump of the DOM rather than a text | |
| 727 // representation of the renderer. | |
| 728 bool dump_as_markup_; | |
| 729 | |
| 730 // If true and if dump_as_markup_ is true, the test_shell will recursively | |
| 731 // produce a dump of the DOM rather than a text representation of the | |
| 732 // renderer. | |
| 733 bool dump_child_frames_as_markup_; | |
| 734 | |
| 735 // If true, the test_shell will print out the child frame scroll offsets as | |
| 736 // well. | |
| 737 bool dump_child_frame_scroll_positions_; | |
| 738 | 716 |
| 739 // If true, the test_shell will print out the icon change notifications. | 717 // If true, the test_shell will print out the icon change notifications. |
| 740 bool dump_icon_changes_; | 718 bool dump_icon_changes_; |
| 741 | 719 |
| 742 // If true, the test_shell will output a base64 encoded WAVE file. | 720 // If true, the test_shell will output a base64 encoded WAVE file. |
| 743 bool dump_as_audio_; | 721 bool dump_as_audio_; |
| 744 | 722 |
| 745 // If true, the test_shell will output a descriptive line for each frame | 723 // If true, the test_shell will output a descriptive line for each frame |
| 746 // load callback. | 724 // load callback. |
| 747 bool dump_frame_load_callbacks_; | 725 bool dump_frame_load_callbacks_; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 801 bool dump_navigation_policy_; | 779 bool dump_navigation_policy_; |
| 802 | 780 |
| 803 // If true, pixel dump will be produced as a series of 1px-tall, view-wide | 781 // If true, pixel dump will be produced as a series of 1px-tall, view-wide |
| 804 // individual paints over the height of the view. | 782 // individual paints over the height of the view. |
| 805 bool test_repaint_; | 783 bool test_repaint_; |
| 806 | 784 |
| 807 // If true and test_repaint_ is true as well, pixel dump will be produced as | 785 // If true and test_repaint_ is true as well, pixel dump will be produced as |
| 808 // a series of 1px-wide, view-tall paints across the width of the view. | 786 // a series of 1px-wide, view-tall paints across the width of the view. |
| 809 bool sweep_horizontally_; | 787 bool sweep_horizontally_; |
| 810 | 788 |
| 811 // If true, layout is to target printed pages. | |
| 812 bool is_printing_; | |
| 813 | |
| 814 // If false, MockWebMIDIAccessor fails on startSession() for testing. | 789 // If false, MockWebMIDIAccessor fails on startSession() for testing. |
| 815 bool midi_accessor_result_; | 790 bool midi_accessor_result_; |
| 816 | 791 |
| 817 bool should_stay_on_page_after_handling_before_unload_; | 792 bool should_stay_on_page_after_handling_before_unload_; |
| 818 | 793 |
| 819 bool should_dump_resource_priorities_; | 794 bool should_dump_resource_priorities_; |
| 820 | 795 |
| 821 bool has_custom_text_output_; | 796 bool has_custom_text_output_; |
| 822 std::string custom_text_output_; | 797 std::string custom_text_output_; |
| 823 | 798 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 849 bool use_mock_theme_; | 824 bool use_mock_theme_; |
| 850 | 825 |
| 851 base::WeakPtrFactory<TestRunner> weak_factory_; | 826 base::WeakPtrFactory<TestRunner> weak_factory_; |
| 852 | 827 |
| 853 DISALLOW_COPY_AND_ASSIGN(TestRunner); | 828 DISALLOW_COPY_AND_ASSIGN(TestRunner); |
| 854 }; | 829 }; |
| 855 | 830 |
| 856 } // namespace test_runner | 831 } // namespace test_runner |
| 857 | 832 |
| 858 #endif // COMPONENTS_TEST_RUNNER_TEST_RUNNER_H_ | 833 #endif // COMPONENTS_TEST_RUNNER_TEST_RUNNER_H_ |
| OLD | NEW |