| 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "content/public/common/page_state.h" | 12 #include "content/public/common/page_state.h" |
| 13 #include "content/public/renderer/render_view_observer.h" | 13 #include "content/public/renderer/render_view_observer.h" |
| 14 #include "content/public/renderer/render_view_observer_tracker.h" | 14 #include "content/public/renderer/render_view_observer_tracker.h" |
| 15 #include "content/shell/common/shell_test_configuration.h" | 15 #include "content/shell/common/shell_test_configuration.h" |
| 16 #include "third_party/WebKit/public/testing/WebPreferences.h" | 16 #include "third_party/WebKit/public/testing/WebPreferences.h" |
| 17 #include "third_party/WebKit/public/testing/WebTestDelegate.h" | 17 #include "third_party/WebKit/public/testing/WebTestDelegate.h" |
| 18 #include "v8/include/v8.h" | 18 #include "v8/include/v8.h" |
| 19 | 19 |
| 20 class SkCanvas; | 20 class SkCanvas; |
| 21 | 21 |
| 22 namespace WebKit { | 22 namespace blink { |
| 23 class WebDeviceMotionData; | 23 class WebDeviceMotionData; |
| 24 class WebDeviceOrientationData; | 24 class WebDeviceOrientationData; |
| 25 struct WebRect; | 25 struct WebRect; |
| 26 } | 26 } |
| 27 | 27 |
| 28 namespace WebTestRunner { | 28 namespace WebTestRunner { |
| 29 class WebTestProxyBase; | 29 class WebTestProxyBase; |
| 30 } | 30 } |
| 31 | 31 |
| 32 namespace content { | 32 namespace content { |
| 33 | 33 |
| 34 // This is the renderer side of the webkit test runner. | 34 // This is the renderer side of the webkit test runner. |
| 35 class WebKitTestRunner : public RenderViewObserver, | 35 class WebKitTestRunner : public RenderViewObserver, |
| 36 public RenderViewObserverTracker<WebKitTestRunner>, | 36 public RenderViewObserverTracker<WebKitTestRunner>, |
| 37 public WebTestRunner::WebTestDelegate { | 37 public WebTestRunner::WebTestDelegate { |
| 38 public: | 38 public: |
| 39 explicit WebKitTestRunner(RenderView* render_view); | 39 explicit WebKitTestRunner(RenderView* render_view); |
| 40 virtual ~WebKitTestRunner(); | 40 virtual ~WebKitTestRunner(); |
| 41 | 41 |
| 42 // RenderViewObserver implementation. | 42 // RenderViewObserver implementation. |
| 43 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 43 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 44 virtual void DidClearWindowObject(WebKit::WebFrame* frame) OVERRIDE; | 44 virtual void DidClearWindowObject(blink::WebFrame* frame) OVERRIDE; |
| 45 virtual void Navigate(const GURL& url) OVERRIDE; | 45 virtual void Navigate(const GURL& url) OVERRIDE; |
| 46 virtual void DidCommitProvisionalLoad(WebKit::WebFrame* frame, | 46 virtual void DidCommitProvisionalLoad(blink::WebFrame* frame, |
| 47 bool is_new_navigation) OVERRIDE; | 47 bool is_new_navigation) OVERRIDE; |
| 48 virtual void DidFailProvisionalLoad( | 48 virtual void DidFailProvisionalLoad( |
| 49 WebKit::WebFrame* frame, const WebKit::WebURLError& error) OVERRIDE; | 49 blink::WebFrame* frame, const blink::WebURLError& error) OVERRIDE; |
| 50 | 50 |
| 51 // WebTestDelegate implementation. | 51 // WebTestDelegate implementation. |
| 52 virtual void clearEditCommand(); | 52 virtual void clearEditCommand(); |
| 53 virtual void setEditCommand(const std::string& name, | 53 virtual void setEditCommand(const std::string& name, |
| 54 const std::string& value); | 54 const std::string& value); |
| 55 virtual void setGamepadData(const WebKit::WebGamepads& gamepads); | 55 virtual void setGamepadData(const blink::WebGamepads& gamepads); |
| 56 virtual void setDeviceMotionData(const WebKit::WebDeviceMotionData& data); | 56 virtual void setDeviceMotionData(const blink::WebDeviceMotionData& data); |
| 57 virtual void setDeviceOrientationData( | 57 virtual void setDeviceOrientationData( |
| 58 const WebKit::WebDeviceOrientationData& data); | 58 const blink::WebDeviceOrientationData& data); |
| 59 virtual void printMessage(const std::string& message); | 59 virtual void printMessage(const std::string& message); |
| 60 virtual void postTask(::WebTestRunner::WebTask* task); | 60 virtual void postTask(::WebTestRunner::WebTask* task); |
| 61 virtual void postDelayedTask(::WebTestRunner::WebTask* task, | 61 virtual void postDelayedTask(::WebTestRunner::WebTask* task, |
| 62 long long ms); | 62 long long ms); |
| 63 virtual WebKit::WebString registerIsolatedFileSystem( | 63 virtual blink::WebString registerIsolatedFileSystem( |
| 64 const WebKit::WebVector<WebKit::WebString>& absolute_filenames); | 64 const blink::WebVector<blink::WebString>& absolute_filenames); |
| 65 virtual long long getCurrentTimeInMillisecond(); | 65 virtual long long getCurrentTimeInMillisecond(); |
| 66 virtual WebKit::WebString getAbsoluteWebStringFromUTF8Path( | 66 virtual blink::WebString getAbsoluteWebStringFromUTF8Path( |
| 67 const std::string& utf8_path); | 67 const std::string& utf8_path); |
| 68 virtual WebKit::WebURL localFileToDataURL(const WebKit::WebURL& file_url); | 68 virtual blink::WebURL localFileToDataURL(const blink::WebURL& file_url); |
| 69 virtual WebKit::WebURL rewriteLayoutTestsURL(const std::string& utf8_url); | 69 virtual blink::WebURL rewriteLayoutTestsURL(const std::string& utf8_url); |
| 70 virtual ::WebTestRunner::WebPreferences* preferences(); | 70 virtual ::WebTestRunner::WebPreferences* preferences(); |
| 71 virtual void applyPreferences(); | 71 virtual void applyPreferences(); |
| 72 virtual std::string makeURLErrorDescription(const WebKit::WebURLError& error); | 72 virtual std::string makeURLErrorDescription(const blink::WebURLError& error); |
| 73 virtual void useUnfortunateSynchronousResizeMode(bool enable); | 73 virtual void useUnfortunateSynchronousResizeMode(bool enable); |
| 74 virtual void enableAutoResizeMode(const WebKit::WebSize& min_size, | 74 virtual void enableAutoResizeMode(const blink::WebSize& min_size, |
| 75 const WebKit::WebSize& max_size); | 75 const blink::WebSize& max_size); |
| 76 virtual void disableAutoResizeMode(const WebKit::WebSize& new_size); | 76 virtual void disableAutoResizeMode(const blink::WebSize& new_size); |
| 77 virtual void showDevTools(); | 77 virtual void showDevTools(); |
| 78 virtual void closeDevTools(); | 78 virtual void closeDevTools(); |
| 79 virtual void evaluateInWebInspector(long call_id, const std::string& script); | 79 virtual void evaluateInWebInspector(long call_id, const std::string& script); |
| 80 virtual void clearAllDatabases(); | 80 virtual void clearAllDatabases(); |
| 81 virtual void setDatabaseQuota(int quota); | 81 virtual void setDatabaseQuota(int quota); |
| 82 virtual void setDeviceScaleFactor(float factor); | 82 virtual void setDeviceScaleFactor(float factor); |
| 83 virtual void setFocus(WebTestRunner::WebTestProxyBase* proxy, bool focus); | 83 virtual void setFocus(WebTestRunner::WebTestProxyBase* proxy, bool focus); |
| 84 virtual void setAcceptAllCookies(bool accept); | 84 virtual void setAcceptAllCookies(bool accept); |
| 85 virtual std::string pathToLocalResource(const std::string& resource); | 85 virtual std::string pathToLocalResource(const std::string& resource); |
| 86 virtual void setLocale(const std::string& locale); | 86 virtual void setLocale(const std::string& locale); |
| 87 virtual void testFinished(); | 87 virtual void testFinished(); |
| 88 virtual void closeRemainingWindows(); | 88 virtual void closeRemainingWindows(); |
| 89 virtual void deleteAllCookies(); | 89 virtual void deleteAllCookies(); |
| 90 virtual int navigationEntryCount(); | 90 virtual int navigationEntryCount(); |
| 91 virtual void goToOffset(int offset); | 91 virtual void goToOffset(int offset); |
| 92 virtual void reload(); | 92 virtual void reload(); |
| 93 virtual void loadURLForFrame(const WebKit::WebURL& url, | 93 virtual void loadURLForFrame(const blink::WebURL& url, |
| 94 const std::string& frame_name); | 94 const std::string& frame_name); |
| 95 virtual bool allowExternalPages(); | 95 virtual bool allowExternalPages(); |
| 96 virtual void captureHistoryForWindow( | 96 virtual void captureHistoryForWindow( |
| 97 WebTestRunner::WebTestProxyBase* proxy, | 97 WebTestRunner::WebTestProxyBase* proxy, |
| 98 WebKit::WebVector<WebKit::WebHistoryItem>* history, | 98 blink::WebVector<blink::WebHistoryItem>* history, |
| 99 size_t* currentEntryIndex); | 99 size_t* currentEntryIndex); |
| 100 | 100 |
| 101 void Reset(); | 101 void Reset(); |
| 102 | 102 |
| 103 void set_proxy(::WebTestRunner::WebTestProxyBase* proxy) { proxy_ = proxy; } | 103 void set_proxy(::WebTestRunner::WebTestProxyBase* proxy) { proxy_ = proxy; } |
| 104 ::WebTestRunner::WebTestProxyBase* proxy() const { return proxy_; } | 104 ::WebTestRunner::WebTestProxyBase* proxy() const { return proxy_; } |
| 105 | 105 |
| 106 private: | 106 private: |
| 107 // Message handlers. | 107 // Message handlers. |
| 108 void OnSetTestConfiguration(const ShellTestConfiguration& params); | 108 void OnSetTestConfiguration(const ShellTestConfiguration& params); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 132 bool is_main_window_; | 132 bool is_main_window_; |
| 133 | 133 |
| 134 bool focus_on_next_commit_; | 134 bool focus_on_next_commit_; |
| 135 | 135 |
| 136 DISALLOW_COPY_AND_ASSIGN(WebKitTestRunner); | 136 DISALLOW_COPY_AND_ASSIGN(WebKitTestRunner); |
| 137 }; | 137 }; |
| 138 | 138 |
| 139 } // namespace content | 139 } // namespace content |
| 140 | 140 |
| 141 #endif // CONTENT_SHELL_WEBKIT_TEST_RUNNER_H_ | 141 #endif // CONTENT_SHELL_WEBKIT_TEST_RUNNER_H_ |
| OLD | NEW |