| 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" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 virtual long long getCurrentTimeInMillisecond(); | 60 virtual long long getCurrentTimeInMillisecond(); |
| 61 virtual WebKit::WebString getAbsoluteWebStringFromUTF8Path( | 61 virtual WebKit::WebString getAbsoluteWebStringFromUTF8Path( |
| 62 const std::string& utf8_path); | 62 const std::string& utf8_path); |
| 63 virtual WebKit::WebURL localFileToDataURL(const WebKit::WebURL& file_url); | 63 virtual WebKit::WebURL localFileToDataURL(const WebKit::WebURL& file_url); |
| 64 virtual WebKit::WebURL rewriteLayoutTestsURL(const std::string& utf8_url); | 64 virtual WebKit::WebURL rewriteLayoutTestsURL(const std::string& utf8_url); |
| 65 virtual ::WebTestRunner::WebPreferences* preferences(); | 65 virtual ::WebTestRunner::WebPreferences* preferences(); |
| 66 virtual void applyPreferences(); | 66 virtual void applyPreferences(); |
| 67 | 67 |
| 68 // WebTestRunner implementation. | 68 // WebTestRunner implementation. |
| 69 virtual bool shouldDumpEditingCallbacks() const; | 69 virtual bool shouldDumpEditingCallbacks() const; |
| 70 virtual bool shouldDumpFrameLoadCallbacks() const; |
| 71 virtual bool shouldDumpUserGestureInFrameLoadCallbacks() const; |
| 72 virtual bool stopProvisionalFrameLoads() const; |
| 73 virtual bool shouldDumpTitleChanges() const; |
| 70 | 74 |
| 71 void Reset(); | 75 void Reset(); |
| 72 void Display(); | 76 void Display(); |
| 73 void SetXSSAuditorEnabled(bool enabled); | 77 void SetXSSAuditorEnabled(bool enabled); |
| 74 void NotifyDone(); | 78 void NotifyDone(); |
| 75 void DumpAsText(); | 79 void DumpAsText(); |
| 76 void DumpChildFramesAsText(); | 80 void DumpChildFramesAsText(); |
| 77 void SetPrinting(); | 81 void SetPrinting(); |
| 78 void SetShouldStayOnPageAfterHandlingBeforeUnload(bool should_stay_on_page); | 82 void SetShouldStayOnPageAfterHandlingBeforeUnload(bool should_stay_on_page); |
| 79 void WaitUntilDone(); | 83 void WaitUntilDone(); |
| 80 void CanOpenWindows(); | 84 void CanOpenWindows(); |
| 81 void ShowWebInspector(); | 85 void ShowWebInspector(); |
| 82 void CloseWebInspector(); | 86 void CloseWebInspector(); |
| 83 void EvaluateInWebInspector(int32_t call_id, const std::string& script); | 87 void EvaluateInWebInspector(int32_t call_id, const std::string& script); |
| 84 void ExecCommand(const std::string& command, const std::string& value); | 88 void ExecCommand(const std::string& command, const std::string& value); |
| 85 void OverridePreference(const std::string& key, v8::Local<v8::Value> value); | 89 void OverridePreference(const std::string& key, v8::Local<v8::Value> value); |
| 86 void DumpEditingCallbacks(); | 90 void DumpEditingCallbacks(); |
| 91 void DumpFrameLoadCallbacks(); |
| 92 void DumpUserGestureInFrameLoadCallbacks(); |
| 93 void StopProvisionalFrameLoads(); |
| 94 void DumpTitleChanges(); |
| 87 | 95 |
| 88 void NotImplemented(const std::string& object, const std::string& method); | 96 void NotImplemented(const std::string& object, const std::string& method); |
| 89 | 97 |
| 90 void set_proxy(::WebTestRunner::WebTestProxyBase* proxy) { proxy_ = proxy; } | 98 void set_proxy(::WebTestRunner::WebTestProxyBase* proxy) { proxy_ = proxy; } |
| 91 | 99 |
| 92 private: | 100 private: |
| 93 // Message handlers. | 101 // Message handlers. |
| 94 void OnCaptureTextDump(bool as_text, bool printing, bool recursive); | 102 void OnCaptureTextDump(bool as_text, bool printing, bool recursive); |
| 95 void OnCaptureImageDump(const std::string& expected_pixel_hash); | 103 void OnCaptureImageDump(const std::string& expected_pixel_hash); |
| 96 void OnSetCurrentWorkingDirectory(const FilePath& current_working_directory); | 104 void OnSetCurrentWorkingDirectory(const FilePath& current_working_directory); |
| 97 | 105 |
| 98 SkCanvas* GetCanvas(); | 106 SkCanvas* GetCanvas(); |
| 99 void PaintRect(const WebKit::WebRect& rect); | 107 void PaintRect(const WebKit::WebRect& rect); |
| 100 void PaintInvalidatedRegion(); | 108 void PaintInvalidatedRegion(); |
| 101 void DisplayRepaintMask(); | 109 void DisplayRepaintMask(); |
| 102 | 110 |
| 103 scoped_ptr<SkCanvas> canvas_; | 111 scoped_ptr<SkCanvas> canvas_; |
| 104 scoped_ptr<WebKit::WebContextMenuData> last_context_menu_data_; | 112 scoped_ptr<WebKit::WebContextMenuData> last_context_menu_data_; |
| 105 FilePath current_working_directory_; | 113 FilePath current_working_directory_; |
| 106 | 114 |
| 107 ::WebTestRunner::WebTestProxyBase* proxy_; | 115 ::WebTestRunner::WebTestProxyBase* proxy_; |
| 108 | 116 |
| 109 ::WebTestRunner::WebPreferences prefs_; | 117 ::WebTestRunner::WebPreferences prefs_; |
| 110 | 118 |
| 111 bool dump_editing_callbacks_; | 119 bool dump_editing_callbacks_; |
| 120 bool dump_frame_load_callbacks_; |
| 121 bool dump_user_gesture_in_frame_load_callbacks_; |
| 122 bool stop_provisional_frame_loads_; |
| 123 bool dump_title_changes_; |
| 124 |
| 125 bool test_is_running_; |
| 126 bool wait_until_done_; |
| 112 | 127 |
| 113 DISALLOW_COPY_AND_ASSIGN(WebKitTestRunner); | 128 DISALLOW_COPY_AND_ASSIGN(WebKitTestRunner); |
| 114 }; | 129 }; |
| 115 | 130 |
| 116 } // namespace content | 131 } // namespace content |
| 117 | 132 |
| 118 #endif // CONTENT_SHELL_WEBKIT_TEST_RUNNER_H_ | 133 #endif // CONTENT_SHELL_WEBKIT_TEST_RUNNER_H_ |
| OLD | NEW |