OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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> |
11 #include <set> | 11 #include <set> |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/basictypes.h" | 15 #include "base/basictypes.h" |
16 #include "base/message_loop.h" | 16 #include "base/message_loop.h" |
| 17 #include "base/process.h" |
17 #include "base/scoped_temp_dir.h" | 18 #include "base/scoped_temp_dir.h" |
18 #include "base/string16.h" | 19 #include "base/string16.h" |
19 #include "chrome/browser/ui/view_ids.h" | 20 #include "chrome/browser/ui/view_ids.h" |
20 #include "chrome/test/automation/dom_element_proxy.h" | 21 #include "chrome/test/automation/dom_element_proxy.h" |
21 #include "content/public/browser/browser_thread.h" | 22 #include "content/public/browser/browser_thread.h" |
22 #include "content/public/browser/notification_observer.h" | 23 #include "content/public/browser/notification_observer.h" |
23 #include "content/public/browser/notification_registrar.h" | 24 #include "content/public/browser/notification_registrar.h" |
24 #include "content/public/browser/notification_details.h" | 25 #include "content/public/browser/notification_details.h" |
25 #include "content/public/browser/notification_source.h" | 26 #include "content/public/browser/notification_source.h" |
26 #include "testing/gtest/include/gtest/gtest.h" | 27 #include "testing/gtest/include/gtest/gtest.h" |
27 #include "ui/base/keycodes/keyboard_codes.h" | 28 #include "ui/base/keycodes/keyboard_codes.h" |
28 #include "ui/gfx/native_widget_types.h" | 29 #include "ui/gfx/native_widget_types.h" |
29 #include "webkit/glue/window_open_disposition.h" | 30 #include "webkit/glue/window_open_disposition.h" |
30 | 31 |
| 32 #if defined(OS_WIN) |
| 33 #include "base/win/scoped_handle.h" |
| 34 #endif |
| 35 |
31 class AppModalDialog; | 36 class AppModalDialog; |
32 class BookmarkModel; | 37 class BookmarkModel; |
33 class Browser; | 38 class Browser; |
34 class CommandLine; | 39 class CommandLine; |
35 class ExtensionAction; | 40 class ExtensionAction; |
36 class FilePath; | 41 class FilePath; |
37 class GURL; | 42 class GURL; |
38 class MessageLoop; | 43 class MessageLoop; |
39 class Profile; | 44 class Profile; |
40 class RenderViewHost; | 45 class RenderViewHost; |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 // Has the server been started? | 334 // Has the server been started? |
330 bool started_; | 335 bool started_; |
331 | 336 |
332 // A Scoped temporary directory for holding the python pid file. | 337 // A Scoped temporary directory for holding the python pid file. |
333 ScopedTempDir temp_dir_; | 338 ScopedTempDir temp_dir_; |
334 | 339 |
335 // Used to close the same python interpreter when server falls out | 340 // Used to close the same python interpreter when server falls out |
336 // scope. | 341 // scope. |
337 FilePath websocket_pid_file_; | 342 FilePath websocket_pid_file_; |
338 | 343 |
| 344 #if defined(OS_POSIX) |
| 345 // ProcessHandle used to terminate child process. |
| 346 base::ProcessHandle process_handle_; |
| 347 #elif defined(OS_WIN) |
| 348 // JobObject used to clean up orphaned child process. |
| 349 base::win::ScopedHandle job_handle_; |
| 350 #endif |
| 351 |
339 DISALLOW_COPY_AND_ASSIGN(TestWebSocketServer); | 352 DISALLOW_COPY_AND_ASSIGN(TestWebSocketServer); |
340 }; | 353 }; |
341 | 354 |
342 // A notification observer which quits the message loop when a notification | 355 // A notification observer which quits the message loop when a notification |
343 // is received. It also records the source and details of the notification. | 356 // is received. It also records the source and details of the notification. |
344 class TestNotificationObserver : public content::NotificationObserver { | 357 class TestNotificationObserver : public content::NotificationObserver { |
345 public: | 358 public: |
346 TestNotificationObserver(); | 359 TestNotificationObserver(); |
347 virtual ~TestNotificationObserver(); | 360 virtual ~TestNotificationObserver(); |
348 | 361 |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 | 572 |
560 // Takes a snapshot of the entire page, according to the width and height | 573 // Takes a snapshot of the entire page, according to the width and height |
561 // properties of the DOM's document. Returns true on success. DOMAutomation | 574 // properties of the DOM's document. Returns true on success. DOMAutomation |
562 // must be enabled. | 575 // must be enabled. |
563 bool TakeEntirePageSnapshot(RenderViewHost* rvh, | 576 bool TakeEntirePageSnapshot(RenderViewHost* rvh, |
564 SkBitmap* bitmap) WARN_UNUSED_RESULT; | 577 SkBitmap* bitmap) WARN_UNUSED_RESULT; |
565 | 578 |
566 } // namespace ui_test_utils | 579 } // namespace ui_test_utils |
567 | 580 |
568 #endif // CHROME_TEST_BASE_UI_TEST_UTILS_H_ | 581 #endif // CHROME_TEST_BASE_UI_TEST_UTILS_H_ |
OLD | NEW |