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/memory/scoped_ptr.h" |
8 #include "content/public/renderer/render_view_observer.h" | 9 #include "content/public/renderer/render_view_observer.h" |
| 10 #include "third_party/WebKit/Tools/DumpRenderTree/chromium/TestRunner/public/Web
TestDelegate.h" |
9 | 11 |
10 namespace content { | 12 namespace content { |
11 | 13 |
12 // This is the renderer side of the webkit test runner. | 14 // This is the renderer side of the webkit test runner. |
13 class WebKitTestRunner : public RenderViewObserver { | 15 class WebKitTestRunner : public RenderViewObserver, |
| 16 public WebTestRunner::WebTestDelegate { |
14 public: | 17 public: |
15 explicit WebKitTestRunner(RenderView* render_view); | 18 explicit WebKitTestRunner(RenderView* render_view); |
16 virtual ~WebKitTestRunner(); | 19 virtual ~WebKitTestRunner(); |
17 | 20 |
18 // RenderViewObserver implementation. | 21 // RenderViewObserver implementation. |
19 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 22 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
20 virtual void DidClearWindowObject(WebKit::WebFrame* frame) OVERRIDE; | 23 virtual void DidClearWindowObject(WebKit::WebFrame* frame) OVERRIDE; |
21 virtual void DidFinishLoad(WebKit::WebFrame* frame) OVERRIDE; | 24 virtual void DidFinishLoad(WebKit::WebFrame* frame) OVERRIDE; |
| 25 virtual void DidRequestShowContextMenu( |
| 26 WebKit::WebFrame* frame, |
| 27 const WebKit::WebContextMenuData& data) OVERRIDE; |
| 28 |
| 29 // WebTestDelegate implementation. |
| 30 virtual void clearContextMenuData() OVERRIDE; |
| 31 virtual void clearEditCommand() OVERRIDE; |
| 32 virtual void fillSpellingSuggestionList( |
| 33 const WebKit::WebString& word, |
| 34 WebKit::WebVector<WebKit::WebString>* suggestions) OVERRIDE; |
| 35 virtual void setEditCommand(const std::string& name, |
| 36 const std::string& value) OVERRIDE; |
| 37 virtual WebKit::WebContextMenuData* lastContextMenuData() const OVERRIDE; |
| 38 virtual void setGamepadData(const WebKit::WebGamepads& gamepads) OVERRIDE; |
| 39 virtual void printMessage(const std::string& message) OVERRIDE; |
| 40 virtual void postTask(WebTestRunner::WebTask* task) OVERRIDE; |
| 41 virtual void postDelayedTask(WebTestRunner::WebTask* task, |
| 42 long long ms) OVERRIDE; |
| 43 virtual WebKit::WebString registerIsolatedFileSystem( |
| 44 const WebKit::WebVector<WebKit::WebString>& absolute_filenames) OVERRIDE; |
| 45 virtual long long getCurrentTimeInMillisecond() OVERRIDE; |
| 46 virtual WebKit::WebString getAbsoluteWebStringFromUTF8Path( |
| 47 const std::string& utf8_path) OVERRIDE; |
22 | 48 |
23 private: | 49 private: |
24 // Message handlers. | 50 // Message handlers. |
25 void OnCaptureTextDump(bool as_text, bool printing, bool recursive); | 51 void OnCaptureTextDump(bool as_text, bool printing, bool recursive); |
26 void OnCaptureImageDump(const std::string& expected_pixel_hash); | 52 void OnCaptureImageDump(const std::string& expected_pixel_hash); |
| 53 void OnSetIsMainWindow(); |
| 54 |
| 55 scoped_ptr<WebKit::WebContextMenuData> last_context_menu_data_; |
| 56 bool is_main_window_; |
27 | 57 |
28 DISALLOW_COPY_AND_ASSIGN(WebKitTestRunner); | 58 DISALLOW_COPY_AND_ASSIGN(WebKitTestRunner); |
29 }; | 59 }; |
30 | 60 |
31 } // namespace content | 61 } // namespace content |
32 | 62 |
33 #endif // CONTENT_SHELL_WEBKIT_TEST_RUNNER_H_ | 63 #endif // CONTENT_SHELL_WEBKIT_TEST_RUNNER_H_ |
OLD | NEW |