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