| 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" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 namespace blink { | 24 namespace blink { |
| 25 class WebBatteryStatus; | 25 class WebBatteryStatus; |
| 26 class WebDeviceMotionData; | 26 class WebDeviceMotionData; |
| 27 class WebDeviceOrientationData; | 27 class WebDeviceOrientationData; |
| 28 struct WebRect; | 28 struct WebRect; |
| 29 } | 29 } |
| 30 | 30 |
| 31 namespace content { | 31 namespace content { |
| 32 | 32 |
| 33 class IPCEcho; | |
| 34 class LeakDetector; | 33 class LeakDetector; |
| 35 class WebTestProxyBase; | 34 class WebTestProxyBase; |
| 36 struct LeakDetectionResult; | 35 struct LeakDetectionResult; |
| 37 | 36 |
| 38 // This is the renderer side of the webkit test runner. | 37 // This is the renderer side of the webkit test runner. |
| 39 class WebKitTestRunner : public RenderViewObserver, | 38 class WebKitTestRunner : public RenderViewObserver, |
| 40 public RenderViewObserverTracker<WebKitTestRunner>, | 39 public RenderViewObserverTracker<WebKitTestRunner>, |
| 41 public WebTestDelegate { | 40 public WebTestDelegate { |
| 42 public: | 41 public: |
| 43 explicit WebKitTestRunner(RenderView* render_view); | 42 explicit WebKitTestRunner(RenderView* render_view); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 virtual void testFinished() OVERRIDE; | 107 virtual void testFinished() OVERRIDE; |
| 109 virtual void closeRemainingWindows() OVERRIDE; | 108 virtual void closeRemainingWindows() OVERRIDE; |
| 110 virtual void deleteAllCookies() OVERRIDE; | 109 virtual void deleteAllCookies() OVERRIDE; |
| 111 virtual int navigationEntryCount() OVERRIDE; | 110 virtual int navigationEntryCount() OVERRIDE; |
| 112 virtual void goToOffset(int offset) OVERRIDE; | 111 virtual void goToOffset(int offset) OVERRIDE; |
| 113 virtual void reload() OVERRIDE; | 112 virtual void reload() OVERRIDE; |
| 114 virtual void loadURLForFrame(const blink::WebURL& url, | 113 virtual void loadURLForFrame(const blink::WebURL& url, |
| 115 const std::string& frame_name) OVERRIDE; | 114 const std::string& frame_name) OVERRIDE; |
| 116 virtual bool allowExternalPages() OVERRIDE; | 115 virtual bool allowExternalPages() OVERRIDE; |
| 117 virtual std::string dumpHistoryForWindow(WebTestProxyBase* proxy) OVERRIDE; | 116 virtual std::string dumpHistoryForWindow(WebTestProxyBase* proxy) OVERRIDE; |
| 118 virtual void requestEcho(int id, int size) OVERRIDE; | |
| 119 virtual int lastEchoId() OVERRIDE; | |
| 120 virtual int lastEchoSize() OVERRIDE; | |
| 121 | 117 |
| 122 void Reset(); | 118 void Reset(); |
| 123 | 119 |
| 124 void set_proxy(WebTestProxyBase* proxy) { proxy_ = proxy; } | 120 void set_proxy(WebTestProxyBase* proxy) { proxy_ = proxy; } |
| 125 WebTestProxyBase* proxy() const { return proxy_; } | 121 WebTestProxyBase* proxy() const { return proxy_; } |
| 126 | 122 |
| 127 void ReportLeakDetectionResult(const LeakDetectionResult& result); | 123 void ReportLeakDetectionResult(const LeakDetectionResult& result); |
| 128 | 124 |
| 129 private: | 125 private: |
| 130 // Message handlers. | 126 // Message handlers. |
| 131 void OnEchoPong(int id, const std::string& body); | |
| 132 void OnSetTestConfiguration(const ShellTestConfiguration& params); | 127 void OnSetTestConfiguration(const ShellTestConfiguration& params); |
| 133 void OnSessionHistory( | 128 void OnSessionHistory( |
| 134 const std::vector<int>& routing_ids, | 129 const std::vector<int>& routing_ids, |
| 135 const std::vector<std::vector<PageState> >& session_histories, | 130 const std::vector<std::vector<PageState> >& session_histories, |
| 136 const std::vector<unsigned>& current_entry_indexes); | 131 const std::vector<unsigned>& current_entry_indexes); |
| 137 void OnReset(); | 132 void OnReset(); |
| 138 void OnNotifyDone(); | 133 void OnNotifyDone(); |
| 139 void OnTryLeakDetection(); | 134 void OnTryLeakDetection(); |
| 140 | 135 |
| 141 // After finishing the test, retrieves the audio, text, and pixel dumps from | 136 // After finishing the test, retrieves the audio, text, and pixel dumps from |
| (...skipping 12 matching lines...) Expand all Loading... |
| 154 | 149 |
| 155 std::vector<int> routing_ids_; | 150 std::vector<int> routing_ids_; |
| 156 std::vector<std::vector<PageState> > session_histories_; | 151 std::vector<std::vector<PageState> > session_histories_; |
| 157 std::vector<unsigned> current_entry_indexes_; | 152 std::vector<unsigned> current_entry_indexes_; |
| 158 | 153 |
| 159 bool is_main_window_; | 154 bool is_main_window_; |
| 160 | 155 |
| 161 bool focus_on_next_commit_; | 156 bool focus_on_next_commit_; |
| 162 | 157 |
| 163 scoped_ptr<LeakDetector> leak_detector_; | 158 scoped_ptr<LeakDetector> leak_detector_; |
| 164 scoped_ptr<IPCEcho> ipc_echo_; | |
| 165 bool needs_leak_detector_; | 159 bool needs_leak_detector_; |
| 166 | 160 |
| 167 DISALLOW_COPY_AND_ASSIGN(WebKitTestRunner); | 161 DISALLOW_COPY_AND_ASSIGN(WebKitTestRunner); |
| 168 }; | 162 }; |
| 169 | 163 |
| 170 } // namespace content | 164 } // namespace content |
| 171 | 165 |
| 172 #endif // CONTENT_SHELL_WEBKIT_TEST_RUNNER_H_ | 166 #endif // CONTENT_SHELL_WEBKIT_TEST_RUNNER_H_ |
| OLD | NEW |