| 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 CHROME_TEST_BASE_UI_TEST_UTILS_H_ | 5 #ifndef CHROME_TEST_BASE_UI_TEST_UTILS_H_ |
| 6 #define CHROME_TEST_BASE_UI_TEST_UTILS_H_ | 6 #define CHROME_TEST_BASE_UI_TEST_UTILS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <queue> | 10 #include <queue> |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 class TestWebSocketServer { | 326 class TestWebSocketServer { |
| 327 public: | 327 public: |
| 328 TestWebSocketServer(); | 328 TestWebSocketServer(); |
| 329 | 329 |
| 330 // Stops the python websocket server if it was already started. | 330 // Stops the python websocket server if it was already started. |
| 331 ~TestWebSocketServer(); | 331 ~TestWebSocketServer(); |
| 332 | 332 |
| 333 // Use a random port, useful for tests that are sharded. Returns the port. | 333 // Use a random port, useful for tests that are sharded. Returns the port. |
| 334 int UseRandomPort(); | 334 int UseRandomPort(); |
| 335 | 335 |
| 336 // Serves with TLS. |
| 337 void UseTLS(); |
| 338 |
| 336 // Starts the python websocket server using |root_directory|. Returns whether | 339 // Starts the python websocket server using |root_directory|. Returns whether |
| 337 // the server was successfully started. | 340 // the server was successfully started. |
| 338 bool Start(const FilePath& root_directory); | 341 bool Start(const FilePath& root_directory); |
| 339 | 342 |
| 340 private: | 343 private: |
| 341 // Sets up PYTHONPATH to run websocket_server.py. | 344 // Sets up PYTHONPATH to run websocket_server.py. |
| 342 void SetPythonPath(); | 345 void SetPythonPath(); |
| 343 | 346 |
| 344 // Creates a CommandLine for invoking the python interpreter. | 347 // Creates a CommandLine for invoking the python interpreter. |
| 345 CommandLine* CreatePythonCommandLine(); | 348 CommandLine* CreatePythonCommandLine(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 358 FilePath websocket_pid_file_; | 361 FilePath websocket_pid_file_; |
| 359 | 362 |
| 360 #if defined(OS_POSIX) | 363 #if defined(OS_POSIX) |
| 361 // ProcessHandle used to terminate child process. | 364 // ProcessHandle used to terminate child process. |
| 362 base::ProcessHandle process_group_id_; | 365 base::ProcessHandle process_group_id_; |
| 363 #elif defined(OS_WIN) | 366 #elif defined(OS_WIN) |
| 364 // JobObject used to clean up orphaned child process. | 367 // JobObject used to clean up orphaned child process. |
| 365 base::win::ScopedHandle job_handle_; | 368 base::win::ScopedHandle job_handle_; |
| 366 #endif | 369 #endif |
| 367 | 370 |
| 371 // Holds port number which the python websocket server uses. |
| 368 int port_; | 372 int port_; |
| 369 | 373 |
| 374 // If the python websocket server serves with TLS. |
| 375 bool secure_; |
| 376 |
| 370 DISALLOW_COPY_AND_ASSIGN(TestWebSocketServer); | 377 DISALLOW_COPY_AND_ASSIGN(TestWebSocketServer); |
| 371 }; | 378 }; |
| 372 | 379 |
| 373 // A notification observer which quits the message loop when a notification | 380 // A notification observer which quits the message loop when a notification |
| 374 // is received. It also records the source and details of the notification. | 381 // is received. It also records the source and details of the notification. |
| 375 class TestNotificationObserver : public content::NotificationObserver { | 382 class TestNotificationObserver : public content::NotificationObserver { |
| 376 public: | 383 public: |
| 377 TestNotificationObserver(); | 384 TestNotificationObserver(); |
| 378 virtual ~TestNotificationObserver(); | 385 virtual ~TestNotificationObserver(); |
| 379 | 386 |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 // ui_controls_linux.cc and ui_controls_mac.cc | 644 // ui_controls_linux.cc and ui_controls_mac.cc |
| 638 void ClickTask(ui_controls::MouseButton button, | 645 void ClickTask(ui_controls::MouseButton button, |
| 639 int state, | 646 int state, |
| 640 const base::Closure& followup); | 647 const base::Closure& followup); |
| 641 | 648 |
| 642 } // namespace internal | 649 } // namespace internal |
| 643 | 650 |
| 644 } // namespace ui_test_utils | 651 } // namespace ui_test_utils |
| 645 | 652 |
| 646 #endif // CHROME_TEST_BASE_UI_TEST_UTILS_H_ | 653 #endif // CHROME_TEST_BASE_UI_TEST_UTILS_H_ |
| OLD | NEW |