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_TEST_CONTENT_BROWSER_TEST_UTILS_INTERNAL_H_ | 5 #ifndef CONTENT_TEST_CONTENT_BROWSER_TEST_UTILS_INTERNAL_H_ |
6 #define CONTENT_TEST_CONTENT_BROWSER_TEST_UTILS_INTERNAL_H_ | 6 #define CONTENT_TEST_CONTENT_BROWSER_TEST_UTILS_INTERNAL_H_ |
7 | 7 |
8 // A collection of functions designed for use with content_shell based browser | 8 // A collection of functions designed for use with content_shell based browser |
9 // tests internal to the content/ module. | 9 // tests internal to the content/ module. |
10 // Note: If a function here also works with browser_tests, it should be in | 10 // Note: If a function here also works with browser_tests, it should be in |
11 // the content public API. | 11 // the content public API. |
12 | 12 |
13 #include <string> | 13 #include <string> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "cc/surfaces/surface_id.h" |
17 #include "content/public/browser/resource_dispatcher_host_delegate.h" | 18 #include "content/public/browser/resource_dispatcher_host_delegate.h" |
18 #include "url/gurl.h" | 19 #include "url/gurl.h" |
19 | 20 |
| 21 namespace cc { |
| 22 class SurfaceManager; |
| 23 } |
| 24 |
20 namespace content { | 25 namespace content { |
21 | 26 |
22 class FrameTreeNode; | 27 class FrameTreeNode; |
| 28 class RenderWidgetHostViewChildFrame; |
23 class Shell; | 29 class Shell; |
24 class SiteInstance; | 30 class SiteInstance; |
25 class ToRenderFrameHost; | 31 class ToRenderFrameHost; |
26 | 32 |
27 // Navigates the frame represented by |node| to |url|, blocking until the | 33 // Navigates the frame represented by |node| to |url|, blocking until the |
28 // navigation finishes. | 34 // navigation finishes. |
29 void NavigateFrameToURL(FrameTreeNode* node, const GURL& url); | 35 void NavigateFrameToURL(FrameTreeNode* node, const GURL& url); |
30 | 36 |
31 // Creates compact textual representations of the state of the frame tree that | 37 // Creates compact textual representations of the state of the frame tree that |
32 // is appropriate for use in assertions. | 38 // is appropriate for use in assertions. |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 void RequestBeginning( | 96 void RequestBeginning( |
91 net::URLRequest* request, | 97 net::URLRequest* request, |
92 content::ResourceContext* resource_context, | 98 content::ResourceContext* resource_context, |
93 content::AppCacheService* appcache_service, | 99 content::AppCacheService* appcache_service, |
94 ResourceType resource_type, | 100 ResourceType resource_type, |
95 ScopedVector<content::ResourceThrottle>* throttles) override; | 101 ScopedVector<content::ResourceThrottle>* throttles) override; |
96 | 102 |
97 GURL url_; | 103 GURL url_; |
98 }; | 104 }; |
99 | 105 |
| 106 // Helper class to assist with hit testing surfaces in multiple processes. |
| 107 // WaitForSurfaceReady() will only return after a Surface from |target_view| |
| 108 // has been composited in the top-level frame's Surface. At that point, |
| 109 // browser process hit testing to target_view's Surface can succeed. |
| 110 class SurfaceHitTestReadyNotifier { |
| 111 public: |
| 112 SurfaceHitTestReadyNotifier(RenderWidgetHostViewChildFrame* target_view); |
| 113 ~SurfaceHitTestReadyNotifier() {} |
| 114 |
| 115 void WaitForSurfaceReady(); |
| 116 |
| 117 private: |
| 118 bool ContainsSurfaceId(); |
| 119 |
| 120 cc::SurfaceManager* surface_manager_; |
| 121 cc::SurfaceId root_surface_id_; |
| 122 RenderWidgetHostViewChildFrame* target_view_; |
| 123 |
| 124 DISALLOW_COPY_AND_ASSIGN(SurfaceHitTestReadyNotifier); |
| 125 }; |
| 126 |
100 } // namespace content | 127 } // namespace content |
101 | 128 |
102 #endif // CONTENT_TEST_CONTENT_BROWSER_TEST_UTILS_INTERNAL_H_ | 129 #endif // CONTENT_TEST_CONTENT_BROWSER_TEST_UTILS_INTERNAL_H_ |
OLD | NEW |