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 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <queue> | 9 #include <queue> |
10 #include <set> | 10 #include <set> |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 | 352 |
353 // Stops the python websocket server if it was already started. | 353 // Stops the python websocket server if it was already started. |
354 ~TestWebSocketServer(); | 354 ~TestWebSocketServer(); |
355 | 355 |
356 // Use a random port, useful for tests that are sharded. Returns the port. | 356 // Use a random port, useful for tests that are sharded. Returns the port. |
357 int UseRandomPort(); | 357 int UseRandomPort(); |
358 | 358 |
359 // Serves with TLS. | 359 // Serves with TLS. |
360 void UseTLS(); | 360 void UseTLS(); |
361 | 361 |
| 362 // Requests client cert authentication. |
| 363 void UseClientAuthentication(); |
| 364 |
362 // Starts the python websocket server using |root_directory|. Returns whether | 365 // Starts the python websocket server using |root_directory|. Returns whether |
363 // the server was successfully started. | 366 // the server was successfully started. |
364 bool Start(const FilePath& root_directory); | 367 bool Start(const FilePath& root_directory); |
365 | 368 |
366 private: | 369 private: |
367 // Sets up PYTHONPATH to run websocket_server.py. | 370 // Sets up PYTHONPATH to run websocket_server.py. |
368 void SetPythonPath(); | 371 void SetPythonPath(); |
369 | 372 |
370 // Creates a CommandLine for invoking the python interpreter. | 373 // Creates a CommandLine for invoking the python interpreter. |
371 CommandLine* CreatePythonCommandLine(); | 374 CommandLine* CreatePythonCommandLine(); |
(...skipping 18 matching lines...) Expand all Loading... |
390 // JobObject used to clean up orphaned child process. | 393 // JobObject used to clean up orphaned child process. |
391 base::win::ScopedHandle job_handle_; | 394 base::win::ScopedHandle job_handle_; |
392 #endif | 395 #endif |
393 | 396 |
394 // Holds port number which the python websocket server uses. | 397 // Holds port number which the python websocket server uses. |
395 int port_; | 398 int port_; |
396 | 399 |
397 // If the python websocket server serves with TLS. | 400 // If the python websocket server serves with TLS. |
398 bool secure_; | 401 bool secure_; |
399 | 402 |
| 403 // If the python websocket server requests client cert authentication. |
| 404 bool client_authentication_; |
| 405 |
400 DISALLOW_COPY_AND_ASSIGN(TestWebSocketServer); | 406 DISALLOW_COPY_AND_ASSIGN(TestWebSocketServer); |
401 }; | 407 }; |
402 | 408 |
403 // A WindowedNotificationObserver allows code to watch for a notification | 409 // A WindowedNotificationObserver allows code to watch for a notification |
404 // over a window of time. Typically testing code will need to do something | 410 // over a window of time. Typically testing code will need to do something |
405 // like this: | 411 // like this: |
406 // PerformAction() | 412 // PerformAction() |
407 // WaitForCompletionNotification() | 413 // WaitForCompletionNotification() |
408 // This leads to flakiness as there's a window between PerformAction returning | 414 // This leads to flakiness as there's a window between PerformAction returning |
409 // and the observers getting registered, where a notification will be missed. | 415 // and the observers getting registered, where a notification will be missed. |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 // ui_controls_linux.cc and ui_controls_mac.cc | 700 // ui_controls_linux.cc and ui_controls_mac.cc |
695 void ClickTask(ui_controls::MouseButton button, | 701 void ClickTask(ui_controls::MouseButton button, |
696 int state, | 702 int state, |
697 const base::Closure& followup); | 703 const base::Closure& followup); |
698 | 704 |
699 } // namespace internal | 705 } // namespace internal |
700 | 706 |
701 } // namespace ui_test_utils | 707 } // namespace ui_test_utils |
702 | 708 |
703 #endif // CHROME_TEST_BASE_UI_TEST_UTILS_H_ | 709 #endif // CHROME_TEST_BASE_UI_TEST_UTILS_H_ |
OLD | NEW |