| 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_HOST_H_ | 5 #ifndef CONTENT_SHELL_WEBKIT_TEST_RUNNER_HOST_H_ |
| 6 #define CONTENT_SHELL_WEBKIT_TEST_RUNNER_HOST_H_ | 6 #define CONTENT_SHELL_WEBKIT_TEST_RUNNER_HOST_H_ |
| 7 | 7 |
| 8 #include <ostream> | 8 #include <ostream> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 should_stay_on_page_after_handling_before_unload; | 102 should_stay_on_page_after_handling_before_unload; |
| 103 } | 103 } |
| 104 bool dump_as_text() const { return dump_as_text_; } | 104 bool dump_as_text() const { return dump_as_text_; } |
| 105 void set_dump_as_text(bool dump_as_text) { dump_as_text_ = dump_as_text; } | 105 void set_dump_as_text(bool dump_as_text) { dump_as_text_ = dump_as_text; } |
| 106 bool dump_child_frames() const { return dump_child_frames_; } | 106 bool dump_child_frames() const { return dump_child_frames_; } |
| 107 void set_dump_child_frames(bool dump_child_frames) { | 107 void set_dump_child_frames(bool dump_child_frames) { |
| 108 dump_child_frames_ = dump_child_frames; | 108 dump_child_frames_ = dump_child_frames; |
| 109 } | 109 } |
| 110 bool is_printing() const { return is_printing_; } | 110 bool is_printing() const { return is_printing_; } |
| 111 void set_is_printing(bool is_printing) { is_printing_ = is_printing; } | 111 void set_is_printing(bool is_printing) { is_printing_ = is_printing; } |
| 112 bool can_open_windows() const { return can_open_windows_; } | |
| 113 void set_can_open_windows(bool can_open_windows) { | |
| 114 can_open_windows_ = can_open_windows; | |
| 115 } | |
| 116 | 112 |
| 117 // WebContentsObserver implementation. | 113 // WebContentsObserver implementation. |
| 118 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 114 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 119 virtual void PluginCrashed(const FilePath& plugin_path) OVERRIDE; | 115 virtual void PluginCrashed(const FilePath& plugin_path) OVERRIDE; |
| 120 virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE; | 116 virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE; |
| 121 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; | 117 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; |
| 122 virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE; | 118 virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE; |
| 123 | 119 |
| 124 private: | 120 private: |
| 125 static WebKitTestController* instance_; | 121 static WebKitTestController* instance_; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 143 bool enable_pixel_dumping_; | 139 bool enable_pixel_dumping_; |
| 144 std::string expected_pixel_hash_; | 140 std::string expected_pixel_hash_; |
| 145 | 141 |
| 146 bool captured_dump_; | 142 bool captured_dump_; |
| 147 | 143 |
| 148 bool dump_as_text_; | 144 bool dump_as_text_; |
| 149 bool dump_child_frames_; | 145 bool dump_child_frames_; |
| 150 bool is_printing_; | 146 bool is_printing_; |
| 151 bool should_stay_on_page_after_handling_before_unload_; | 147 bool should_stay_on_page_after_handling_before_unload_; |
| 152 bool wait_until_done_; | 148 bool wait_until_done_; |
| 153 bool can_open_windows_; | |
| 154 ShellWebPreferences prefs_; | 149 ShellWebPreferences prefs_; |
| 155 | 150 |
| 156 base::CancelableClosure watchdog_; | 151 base::CancelableClosure watchdog_; |
| 157 | 152 |
| 158 DISALLOW_COPY_AND_ASSIGN(WebKitTestController); | 153 DISALLOW_COPY_AND_ASSIGN(WebKitTestController); |
| 159 }; | 154 }; |
| 160 | 155 |
| 161 class WebKitTestRunnerHost : public RenderViewHostObserver { | 156 class WebKitTestRunnerHost : public RenderViewHostObserver { |
| 162 public: | 157 public: |
| 163 explicit WebKitTestRunnerHost(RenderViewHost* render_view_host); | 158 explicit WebKitTestRunnerHost(RenderViewHost* render_view_host); |
| 164 virtual ~WebKitTestRunnerHost(); | 159 virtual ~WebKitTestRunnerHost(); |
| 165 | 160 |
| 166 // RenderViewHostObserver implementation. | 161 // RenderViewHostObserver implementation. |
| 167 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 162 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 168 | 163 |
| 169 private: | 164 private: |
| 170 // testRunner handlers. | 165 // testRunner handlers. |
| 171 void OnNotifyDone(); | 166 void OnNotifyDone(); |
| 172 void OnDumpAsText(); | 167 void OnDumpAsText(); |
| 173 void OnDumpChildFramesAsText(); | 168 void OnDumpChildFramesAsText(); |
| 174 void OnSetPrinting(); | 169 void OnSetPrinting(); |
| 175 void OnSetShouldStayOnPageAfterHandlingBeforeUnload(bool should_stay_on_page); | 170 void OnSetShouldStayOnPageAfterHandlingBeforeUnload(bool should_stay_on_page); |
| 176 void OnWaitUntilDone(); | 171 void OnWaitUntilDone(); |
| 177 void OnCanOpenWindows(); | |
| 178 | 172 |
| 179 void OnNotImplemented(const std::string& object_name, | 173 void OnNotImplemented(const std::string& object_name, |
| 180 const std::string& method_name); | 174 const std::string& method_name); |
| 181 | 175 |
| 182 DISALLOW_COPY_AND_ASSIGN(WebKitTestRunnerHost); | 176 DISALLOW_COPY_AND_ASSIGN(WebKitTestRunnerHost); |
| 183 }; | 177 }; |
| 184 | 178 |
| 185 } // namespace content | 179 } // namespace content |
| 186 | 180 |
| 187 #endif // CONTENT_SHELL_WEBKIT_TEST_RUNNER_HOST_H_ | 181 #endif // CONTENT_SHELL_WEBKIT_TEST_RUNNER_HOST_H_ |
| OLD | NEW |