| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 | 113 |
| 114 // NotificationObserver implementation. | 114 // NotificationObserver implementation. |
| 115 virtual void Observe(int type, | 115 virtual void Observe(int type, |
| 116 const NotificationSource& source, | 116 const NotificationSource& source, |
| 117 const NotificationDetails& details) OVERRIDE; | 117 const NotificationDetails& details) OVERRIDE; |
| 118 | 118 |
| 119 // GpuDataManagerObserver implementation. | 119 // GpuDataManagerObserver implementation. |
| 120 virtual void OnGpuProcessCrashed(base::TerminationStatus exit_code) OVERRIDE; | 120 virtual void OnGpuProcessCrashed(base::TerminationStatus exit_code) OVERRIDE; |
| 121 | 121 |
| 122 private: | 122 private: |
| 123 enum TestPhase { |
| 124 BETWEEN_TESTS, |
| 125 DURING_TEST, |
| 126 CLEAN_UP |
| 127 }; |
| 128 |
| 123 static WebKitTestController* instance_; | 129 static WebKitTestController* instance_; |
| 124 | 130 |
| 125 void TimeoutHandler(); | 131 void TimeoutHandler(); |
| 126 void DiscardMainWindow(); | 132 void DiscardMainWindow(); |
| 127 void SendTestConfiguration(); | 133 void SendTestConfiguration(); |
| 128 | 134 |
| 129 // Message handlers. | 135 // Message handlers. |
| 130 void OnAudioDump(const std::vector<unsigned char>& audio_dump); | 136 void OnAudioDump(const std::vector<unsigned char>& audio_dump); |
| 131 void OnImageDump(const std::string& actual_pixel_hash, const SkBitmap& image); | 137 void OnImageDump(const std::string& actual_pixel_hash, const SkBitmap& image); |
| 132 void OnTextDump(const std::string& dump); | 138 void OnTextDump(const std::string& dump); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 149 | 155 |
| 150 Shell* main_window_; | 156 Shell* main_window_; |
| 151 | 157 |
| 152 // The PID of the render process of the render view host of main_window_. | 158 // The PID of the render process of the render view host of main_window_. |
| 153 int current_pid_; | 159 int current_pid_; |
| 154 | 160 |
| 155 // True if we should set the test configuration to the next RenderViewHost | 161 // True if we should set the test configuration to the next RenderViewHost |
| 156 // created. | 162 // created. |
| 157 bool send_configuration_to_next_host_; | 163 bool send_configuration_to_next_host_; |
| 158 | 164 |
| 159 // True if we are currently running a layout test, and false during the setup | 165 // What phase of running an individual test we are currently in. |
| 160 // phase between two layout tests. | 166 TestPhase test_phase_; |
| 161 bool is_running_test_; | |
| 162 | 167 |
| 163 // True if the currently running test is a compositing test. | 168 // True if the currently running test is a compositing test. |
| 164 bool is_compositing_test_; | 169 bool is_compositing_test_; |
| 165 | 170 |
| 166 // Per test config. | 171 // Per test config. |
| 167 bool enable_pixel_dumping_; | 172 bool enable_pixel_dumping_; |
| 168 std::string expected_pixel_hash_; | 173 std::string expected_pixel_hash_; |
| 169 gfx::Size initial_size_; | 174 gfx::Size initial_size_; |
| 170 GURL test_url_; | 175 GURL test_url_; |
| 171 | 176 |
| 172 // True if the WebPreferences of newly created RenderViewHost should be | 177 // True if the WebPreferences of newly created RenderViewHost should be |
| 173 // overridden with prefs_. | 178 // overridden with prefs_. |
| 174 bool should_override_prefs_; | 179 bool should_override_prefs_; |
| 175 WebPreferences prefs_; | 180 WebPreferences prefs_; |
| 176 | 181 |
| 177 base::CancelableClosure watchdog_; | 182 base::CancelableClosure watchdog_; |
| 178 | 183 |
| 179 NotificationRegistrar registrar_; | 184 NotificationRegistrar registrar_; |
| 180 | 185 |
| 181 DISALLOW_COPY_AND_ASSIGN(WebKitTestController); | 186 DISALLOW_COPY_AND_ASSIGN(WebKitTestController); |
| 182 }; | 187 }; |
| 183 | 188 |
| 184 } // namespace content | 189 } // namespace content |
| 185 | 190 |
| 186 #endif // CONTENT_SHELL_WEBKIT_TEST_CONTROLLER_H_ | 191 #endif // CONTENT_SHELL_WEBKIT_TEST_CONTROLLER_H_ |
| OLD | NEW |