OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_RENDERER_TEST_RUNNER_TEST_RUNNER_H_ | 5 #ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_RUNNER_H_ |
6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_RUNNER_H_ | 6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_RUNNER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "content/shell/renderer/test_runner/web_task.h" | 14 #include "content/shell/renderer/test_runner/web_task.h" |
15 #include "content/shell/renderer/test_runner/web_test_runner.h" | 15 #include "content/shell/renderer/test_runner/web_test_runner.h" |
16 #include "v8/include/v8.h" | 16 #include "v8/include/v8.h" |
17 | 17 |
18 class GURL; | 18 class GURL; |
19 class SkBitmap; | 19 class SkBitmap; |
20 | 20 |
21 namespace blink { | 21 namespace blink { |
22 class WebFrame; | 22 class WebFrame; |
23 class WebNotificationPresenter; | |
24 class WebPermissionClient; | 23 class WebPermissionClient; |
25 class WebString; | 24 class WebString; |
26 class WebView; | 25 class WebView; |
27 class WebURLResponse; | 26 class WebURLResponse; |
28 } | 27 } |
29 | 28 |
30 namespace gin { | 29 namespace gin { |
31 class ArrayBufferView; | 30 class ArrayBufferView; |
32 class Arguments; | 31 class Arguments; |
33 } | 32 } |
34 | 33 |
35 namespace content { | 34 namespace content { |
36 | 35 |
37 class InvokeCallbackTask; | 36 class InvokeCallbackTask; |
38 class NotificationPresenter; | |
39 class TestInterfaces; | 37 class TestInterfaces; |
40 class TestPageOverlay; | 38 class TestPageOverlay; |
41 class WebPermissions; | 39 class WebPermissions; |
42 class WebTestDelegate; | 40 class WebTestDelegate; |
43 class WebTestProxyBase; | 41 class WebTestProxyBase; |
44 | 42 |
45 class TestRunner : public WebTestRunner, | 43 class TestRunner : public WebTestRunner, |
46 public base::SupportsWeakPtr<TestRunner> { | 44 public base::SupportsWeakPtr<TestRunner> { |
47 public: | 45 public: |
48 explicit TestRunner(TestInterfaces*); | 46 explicit TestRunner(TestInterfaces*); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 bool shouldWaitUntilExternalURLLoad() const; | 108 bool shouldWaitUntilExternalURLLoad() const; |
111 const std::set<std::string>* httpHeadersToClear() const; | 109 const std::set<std::string>* httpHeadersToClear() const; |
112 void setTopLoadingFrame(blink::WebFrame*, bool); | 110 void setTopLoadingFrame(blink::WebFrame*, bool); |
113 blink::WebFrame* topLoadingFrame() const; | 111 blink::WebFrame* topLoadingFrame() const; |
114 void policyDelegateDone(); | 112 void policyDelegateDone(); |
115 bool policyDelegateEnabled() const; | 113 bool policyDelegateEnabled() const; |
116 bool policyDelegateIsPermissive() const; | 114 bool policyDelegateIsPermissive() const; |
117 bool policyDelegateShouldNotifyDone() const; | 115 bool policyDelegateShouldNotifyDone() const; |
118 bool shouldInterceptPostMessage() const; | 116 bool shouldInterceptPostMessage() const; |
119 bool shouldDumpResourcePriorities() const; | 117 bool shouldDumpResourcePriorities() const; |
120 blink::WebNotificationPresenter* notification_presenter() const; | |
121 bool RequestPointerLock(); | 118 bool RequestPointerLock(); |
122 void RequestPointerUnlock(); | 119 void RequestPointerUnlock(); |
123 bool isPointerLocked(); | 120 bool isPointerLocked(); |
124 void setToolTipText(const blink::WebString&); | 121 void setToolTipText(const blink::WebString&); |
125 | 122 |
126 bool midiAccessorResult(); | 123 bool midiAccessorResult(); |
127 | 124 |
128 // A single item in the work queue. | 125 // A single item in the work queue. |
129 class WorkItem { | 126 class WorkItem { |
130 public: | 127 public: |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 void SetMIDIAccessorResult(bool result); | 518 void SetMIDIAccessorResult(bool result); |
522 void SetMIDISysexPermission(bool value); | 519 void SetMIDISysexPermission(bool value); |
523 | 520 |
524 // Grants permission for desktop notifications to an origin | 521 // Grants permission for desktop notifications to an origin |
525 void GrantWebNotificationPermission(const GURL& origin, | 522 void GrantWebNotificationPermission(const GURL& origin, |
526 bool permission_granted); | 523 bool permission_granted); |
527 | 524 |
528 // Clears all previously granted Web Notification permissions. | 525 // Clears all previously granted Web Notification permissions. |
529 void ClearWebNotificationPermissions(); | 526 void ClearWebNotificationPermissions(); |
530 | 527 |
531 // Simulates a click on a desktop notification. | 528 // Simulates a click on a Web Notification. |
532 void SimulateWebNotificationClick(const std::string& title); | 529 void SimulateWebNotificationClick(const std::string& title); |
533 | 530 |
534 // Speech recognition related functions. | 531 // Speech recognition related functions. |
535 void AddMockSpeechRecognitionResult(const std::string& transcript, | 532 void AddMockSpeechRecognitionResult(const std::string& transcript, |
536 double confidence); | 533 double confidence); |
537 void SetMockSpeechRecognitionError(const std::string& error, | 534 void SetMockSpeechRecognitionError(const std::string& error, |
538 const std::string& message); | 535 const std::string& message); |
539 bool WasMockSpeechRecognitionAborted(); | 536 bool WasMockSpeechRecognitionAborted(); |
540 | 537 |
541 // Credential Manager mock functions | 538 // Credential Manager mock functions |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 blink::WebView* web_view_; | 760 blink::WebView* web_view_; |
764 TestPageOverlay* page_overlay_; | 761 TestPageOverlay* page_overlay_; |
765 WebTestProxyBase* proxy_; | 762 WebTestProxyBase* proxy_; |
766 | 763 |
767 // This is non-0 IFF a load is in progress. | 764 // This is non-0 IFF a load is in progress. |
768 blink::WebFrame* top_loading_frame_; | 765 blink::WebFrame* top_loading_frame_; |
769 | 766 |
770 // WebPermissionClient mock object. | 767 // WebPermissionClient mock object. |
771 scoped_ptr<WebPermissions> web_permissions_; | 768 scoped_ptr<WebPermissions> web_permissions_; |
772 | 769 |
773 scoped_ptr<NotificationPresenter> notification_presenter_; | |
774 | |
775 bool pointer_locked_; | 770 bool pointer_locked_; |
776 enum { | 771 enum { |
777 PointerLockWillSucceed, | 772 PointerLockWillSucceed, |
778 PointerLockWillRespondAsync, | 773 PointerLockWillRespondAsync, |
779 PointerLockWillFailSync, | 774 PointerLockWillFailSync, |
780 } pointer_lock_planned_result_; | 775 } pointer_lock_planned_result_; |
781 bool use_mock_theme_; | 776 bool use_mock_theme_; |
782 | 777 |
783 base::WeakPtrFactory<TestRunner> weak_factory_; | 778 base::WeakPtrFactory<TestRunner> weak_factory_; |
784 | 779 |
785 DISALLOW_COPY_AND_ASSIGN(TestRunner); | 780 DISALLOW_COPY_AND_ASSIGN(TestRunner); |
786 }; | 781 }; |
787 | 782 |
788 } // namespace content | 783 } // namespace content |
789 | 784 |
790 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_RUNNER_H_ | 785 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_RUNNER_H_ |
OLD | NEW |