| 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_CONTROLLER_H_ | 5 #ifndef CONTENT_SHELL_WEBKIT_TEST_CONTROLLER_H_ |
| 6 #define CONTENT_SHELL_WEBKIT_TEST_CONTROLLER_H_ | 6 #define CONTENT_SHELL_WEBKIT_TEST_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <ostream> | 8 #include <ostream> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 public WebContentsObserver, | 70 public WebContentsObserver, |
| 71 public NotificationObserver { | 71 public NotificationObserver { |
| 72 public: | 72 public: |
| 73 static WebKitTestController* Get(); | 73 static WebKitTestController* Get(); |
| 74 | 74 |
| 75 WebKitTestController(); | 75 WebKitTestController(); |
| 76 virtual ~WebKitTestController(); | 76 virtual ~WebKitTestController(); |
| 77 | 77 |
| 78 // True if the controller is ready for testing. | 78 // True if the controller is ready for testing. |
| 79 bool PrepareForLayoutTest(const GURL& test_url, | 79 bool PrepareForLayoutTest(const GURL& test_url, |
| 80 const FilePath& current_working_directory, | 80 const base::FilePath& current_working_directory, |
| 81 bool enable_pixel_dumping, | 81 bool enable_pixel_dumping, |
| 82 const std::string& expected_pixel_hash); | 82 const std::string& expected_pixel_hash); |
| 83 // True if the controller was reset successfully. | 83 // True if the controller was reset successfully. |
| 84 bool ResetAfterLayoutTest(); | 84 bool ResetAfterLayoutTest(); |
| 85 | 85 |
| 86 void RendererUnresponsive(); | 86 void RendererUnresponsive(); |
| 87 void OverrideWebkitPrefs(webkit_glue::WebPreferences* prefs); | 87 void OverrideWebkitPrefs(webkit_glue::WebPreferences* prefs); |
| 88 | 88 |
| 89 WebKitTestResultPrinter* printer() { return printer_.get(); } | 89 WebKitTestResultPrinter* printer() { return printer_.get(); } |
| 90 void set_printer(WebKitTestResultPrinter* printer) { | 90 void set_printer(WebKitTestResultPrinter* printer) { |
| 91 printer_.reset(printer); | 91 printer_.reset(printer); |
| 92 } | 92 } |
| 93 bool should_stay_on_page_after_handling_before_unload() const { | 93 bool should_stay_on_page_after_handling_before_unload() const { |
| 94 return should_stay_on_page_after_handling_before_unload_; | 94 return should_stay_on_page_after_handling_before_unload_; |
| 95 } | 95 } |
| 96 | 96 |
| 97 // This method can be invoked on any thread. | 97 // This method can be invoked on any thread. |
| 98 bool CanOpenWindows() const; | 98 bool CanOpenWindows() const; |
| 99 | 99 |
| 100 // WebContentsObserver implementation. | 100 // WebContentsObserver implementation. |
| 101 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 101 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 102 virtual void PluginCrashed(const FilePath& plugin_path, | 102 virtual void PluginCrashed(const base::FilePath& plugin_path, |
| 103 base::ProcessId plugin_pid) OVERRIDE; | 103 base::ProcessId plugin_pid) OVERRIDE; |
| 104 virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE; | 104 virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE; |
| 105 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; | 105 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; |
| 106 virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE; | 106 virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE; |
| 107 | 107 |
| 108 // NotificationObserver implementation. | 108 // NotificationObserver implementation. |
| 109 virtual void Observe(int type, | 109 virtual void Observe(int type, |
| 110 const NotificationSource& source, | 110 const NotificationSource& source, |
| 111 const NotificationDetails& details) OVERRIDE; | 111 const NotificationDetails& details) OVERRIDE; |
| 112 | 112 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 130 void OnWaitUntilDone(); | 130 void OnWaitUntilDone(); |
| 131 void OnCanOpenWindows(); | 131 void OnCanOpenWindows(); |
| 132 void OnShowWebInspector(); | 132 void OnShowWebInspector(); |
| 133 void OnCloseWebInspector(); | 133 void OnCloseWebInspector(); |
| 134 | 134 |
| 135 void OnNotImplemented(const std::string& object_name, | 135 void OnNotImplemented(const std::string& object_name, |
| 136 const std::string& method_name); | 136 const std::string& method_name); |
| 137 | 137 |
| 138 scoped_ptr<WebKitTestResultPrinter> printer_; | 138 scoped_ptr<WebKitTestResultPrinter> printer_; |
| 139 | 139 |
| 140 FilePath current_working_directory_; | 140 base::FilePath current_working_directory_; |
| 141 | 141 |
| 142 Shell* main_window_; | 142 Shell* main_window_; |
| 143 | 143 |
| 144 int current_pid_; | 144 int current_pid_; |
| 145 | 145 |
| 146 bool is_compositing_test_; | 146 bool is_compositing_test_; |
| 147 | 147 |
| 148 bool enable_pixel_dumping_; | 148 bool enable_pixel_dumping_; |
| 149 std::string expected_pixel_hash_; | 149 std::string expected_pixel_hash_; |
| 150 | 150 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 167 bool can_open_windows_; | 167 bool can_open_windows_; |
| 168 | 168 |
| 169 NotificationRegistrar registrar_; | 169 NotificationRegistrar registrar_; |
| 170 | 170 |
| 171 DISALLOW_COPY_AND_ASSIGN(WebKitTestController); | 171 DISALLOW_COPY_AND_ASSIGN(WebKitTestController); |
| 172 }; | 172 }; |
| 173 | 173 |
| 174 } // namespace content | 174 } // namespace content |
| 175 | 175 |
| 176 #endif // CONTENT_SHELL_WEBKIT_TEST_CONTROLLER_H_ | 176 #endif // CONTENT_SHELL_WEBKIT_TEST_CONTROLLER_H_ |
| OLD | NEW |