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