OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_SHELL_WEBKIT_TEST_RUNNER_H_ | 5 #ifndef CONTENT_SHELL_WEBKIT_TEST_RUNNER_H_ |
6 #define CONTENT_SHELL_WEBKIT_TEST_RUNNER_H_ | 6 #define CONTENT_SHELL_WEBKIT_TEST_RUNNER_H_ |
7 | 7 |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "content/public/renderer/render_view_observer.h" | 10 #include "content/public/renderer/render_view_observer.h" |
| 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIntentRequest.h" |
11 #include "third_party/WebKit/Tools/DumpRenderTree/chromium/TestRunner/public/Web
Preferences.h" | 12 #include "third_party/WebKit/Tools/DumpRenderTree/chromium/TestRunner/public/Web
Preferences.h" |
12 #include "third_party/WebKit/Tools/DumpRenderTree/chromium/TestRunner/public/Web
TestDelegate.h" | 13 #include "third_party/WebKit/Tools/DumpRenderTree/chromium/TestRunner/public/Web
TestDelegate.h" |
13 #include "third_party/WebKit/Tools/DumpRenderTree/chromium/TestRunner/public/Web
TestRunner.h" | 14 #include "third_party/WebKit/Tools/DumpRenderTree/chromium/TestRunner/public/Web
TestRunner.h" |
14 #include "v8/include/v8.h" | 15 #include "v8/include/v8.h" |
15 | 16 |
16 class SkCanvas; | 17 class SkCanvas; |
17 | 18 |
18 namespace WebKit { | 19 namespace WebKit { |
19 struct WebRect; | 20 struct WebRect; |
20 } | 21 } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 long long ms); | 58 long long ms); |
58 virtual WebKit::WebString registerIsolatedFileSystem( | 59 virtual WebKit::WebString registerIsolatedFileSystem( |
59 const WebKit::WebVector<WebKit::WebString>& absolute_filenames); | 60 const WebKit::WebVector<WebKit::WebString>& absolute_filenames); |
60 virtual long long getCurrentTimeInMillisecond(); | 61 virtual long long getCurrentTimeInMillisecond(); |
61 virtual WebKit::WebString getAbsoluteWebStringFromUTF8Path( | 62 virtual WebKit::WebString getAbsoluteWebStringFromUTF8Path( |
62 const std::string& utf8_path); | 63 const std::string& utf8_path); |
63 virtual WebKit::WebURL localFileToDataURL(const WebKit::WebURL& file_url); | 64 virtual WebKit::WebURL localFileToDataURL(const WebKit::WebURL& file_url); |
64 virtual WebKit::WebURL rewriteLayoutTestsURL(const std::string& utf8_url); | 65 virtual WebKit::WebURL rewriteLayoutTestsURL(const std::string& utf8_url); |
65 virtual ::WebTestRunner::WebPreferences* preferences(); | 66 virtual ::WebTestRunner::WebPreferences* preferences(); |
66 virtual void applyPreferences(); | 67 virtual void applyPreferences(); |
| 68 virtual void setCurrentWebIntentRequest(const WebKit::WebIntentRequest&); |
| 69 virtual WebKit::WebIntentRequest* currentWebIntentRequest(); |
| 70 virtual std::string makeURLErrorDescription(const WebKit::WebURLError& error); |
67 | 71 |
68 // WebTestRunner implementation. | 72 // WebTestRunner implementation. |
69 virtual bool shouldDumpEditingCallbacks() const; | 73 virtual bool shouldDumpEditingCallbacks() const; |
70 virtual bool shouldDumpFrameLoadCallbacks() const; | 74 virtual bool shouldDumpFrameLoadCallbacks() const; |
71 virtual bool shouldDumpUserGestureInFrameLoadCallbacks() const; | 75 virtual bool shouldDumpUserGestureInFrameLoadCallbacks() const; |
72 virtual bool stopProvisionalFrameLoads() const; | 76 virtual bool stopProvisionalFrameLoads() const; |
73 virtual bool shouldDumpTitleChanges() const; | 77 virtual bool shouldDumpTitleChanges() const; |
| 78 virtual bool shouldDumpResourceLoadCallbacks() const; |
| 79 virtual bool shouldDumpResourceRequestCallbacks() const; |
| 80 virtual bool shouldDumpResourceResponseMIMETypes() const; |
| 81 virtual bool shouldDumpCreateView() const; |
| 82 virtual bool canOpenWindows() const; |
74 | 83 |
75 void Reset(); | 84 void Reset(); |
76 void Display(); | 85 void Display(); |
77 void SetXSSAuditorEnabled(bool enabled); | 86 void SetXSSAuditorEnabled(bool enabled); |
78 void NotifyDone(); | 87 void NotifyDone(); |
79 void DumpAsText(); | 88 void DumpAsText(); |
80 void DumpChildFramesAsText(); | 89 void DumpChildFramesAsText(); |
81 void SetPrinting(); | 90 void SetPrinting(); |
82 void SetShouldStayOnPageAfterHandlingBeforeUnload(bool should_stay_on_page); | 91 void SetShouldStayOnPageAfterHandlingBeforeUnload(bool should_stay_on_page); |
83 void WaitUntilDone(); | 92 void WaitUntilDone(); |
84 void CanOpenWindows(); | 93 void CanOpenWindows(); |
85 void ShowWebInspector(); | 94 void ShowWebInspector(); |
86 void CloseWebInspector(); | 95 void CloseWebInspector(); |
87 void EvaluateInWebInspector(int32_t call_id, const std::string& script); | 96 void EvaluateInWebInspector(int32_t call_id, const std::string& script); |
88 void ExecCommand(const std::string& command, const std::string& value); | 97 void ExecCommand(const std::string& command, const std::string& value); |
89 void OverridePreference(const std::string& key, v8::Local<v8::Value> value); | 98 void OverridePreference(const std::string& key, v8::Local<v8::Value> value); |
90 void DumpEditingCallbacks(); | 99 void DumpEditingCallbacks(); |
91 void DumpFrameLoadCallbacks(); | 100 void DumpFrameLoadCallbacks(); |
92 void DumpUserGestureInFrameLoadCallbacks(); | 101 void DumpUserGestureInFrameLoadCallbacks(); |
93 void StopProvisionalFrameLoads(); | 102 void StopProvisionalFrameLoads(); |
94 void DumpTitleChanges(); | 103 void DumpTitleChanges(); |
| 104 void DumpResourceLoadCallbacks(); |
| 105 void DumpResourceRequestCallbacks(); |
| 106 void DumpResourceResponseMIMETypes(); |
| 107 void DumpCreateView(); |
95 | 108 |
96 void NotImplemented(const std::string& object, const std::string& method); | 109 void NotImplemented(const std::string& object, const std::string& method); |
97 | 110 |
98 void set_proxy(::WebTestRunner::WebTestProxyBase* proxy) { proxy_ = proxy; } | 111 void set_proxy(::WebTestRunner::WebTestProxyBase* proxy) { proxy_ = proxy; } |
99 | 112 |
100 private: | 113 private: |
101 // Message handlers. | 114 // Message handlers. |
102 void OnCaptureTextDump(bool as_text, bool printing, bool recursive); | 115 void OnCaptureTextDump(bool as_text, bool printing, bool recursive); |
103 void OnCaptureImageDump(const std::string& expected_pixel_hash); | 116 void OnCaptureImageDump(const std::string& expected_pixel_hash); |
104 void OnSetCurrentWorkingDirectory(const FilePath& current_working_directory); | 117 void OnSetCurrentWorkingDirectory(const FilePath& current_working_directory); |
105 | 118 |
106 SkCanvas* GetCanvas(); | 119 SkCanvas* GetCanvas(); |
107 void PaintRect(const WebKit::WebRect& rect); | 120 void PaintRect(const WebKit::WebRect& rect); |
108 void PaintInvalidatedRegion(); | 121 void PaintInvalidatedRegion(); |
109 void DisplayRepaintMask(); | 122 void DisplayRepaintMask(); |
110 | 123 |
111 scoped_ptr<SkCanvas> canvas_; | 124 scoped_ptr<SkCanvas> canvas_; |
112 scoped_ptr<WebKit::WebContextMenuData> last_context_menu_data_; | 125 scoped_ptr<WebKit::WebContextMenuData> last_context_menu_data_; |
113 FilePath current_working_directory_; | 126 FilePath current_working_directory_; |
114 | 127 |
115 ::WebTestRunner::WebTestProxyBase* proxy_; | 128 ::WebTestRunner::WebTestProxyBase* proxy_; |
116 | 129 |
117 ::WebTestRunner::WebPreferences prefs_; | 130 ::WebTestRunner::WebPreferences prefs_; |
118 | 131 |
| 132 WebKit::WebIntentRequest intent_request_; |
| 133 |
119 bool dump_editing_callbacks_; | 134 bool dump_editing_callbacks_; |
120 bool dump_frame_load_callbacks_; | 135 bool dump_frame_load_callbacks_; |
121 bool dump_user_gesture_in_frame_load_callbacks_; | 136 bool dump_user_gesture_in_frame_load_callbacks_; |
122 bool stop_provisional_frame_loads_; | 137 bool stop_provisional_frame_loads_; |
123 bool dump_title_changes_; | 138 bool dump_title_changes_; |
| 139 bool dump_resource_load_callbacks_; |
| 140 bool dump_resource_request_callbacks_; |
| 141 bool dump_resource_response_mime_types_; |
| 142 bool dump_create_view_; |
| 143 bool can_open_windows_; |
124 | 144 |
125 bool test_is_running_; | 145 bool test_is_running_; |
126 bool wait_until_done_; | 146 bool wait_until_done_; |
127 bool load_finished_; | 147 bool load_finished_; |
128 | 148 |
129 DISALLOW_COPY_AND_ASSIGN(WebKitTestRunner); | 149 DISALLOW_COPY_AND_ASSIGN(WebKitTestRunner); |
130 }; | 150 }; |
131 | 151 |
132 } // namespace content | 152 } // namespace content |
133 | 153 |
134 #endif // CONTENT_SHELL_WEBKIT_TEST_RUNNER_H_ | 154 #endif // CONTENT_SHELL_WEBKIT_TEST_RUNNER_H_ |
OLD | NEW |