Chromium Code Reviews| 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 CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ |
| 6 #define CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ | 6 #define CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 228 // no frames match the specified predicate, or if more than one frame matches. | 228 // no frames match the specified predicate, or if more than one frame matches. |
| 229 RenderFrameHost* FrameMatchingPredicate( | 229 RenderFrameHost* FrameMatchingPredicate( |
| 230 WebContents* web_contents, | 230 WebContents* web_contents, |
| 231 const base::Callback<bool(RenderFrameHost*)>& predicate); | 231 const base::Callback<bool(RenderFrameHost*)>& predicate); |
| 232 | 232 |
| 233 // Predicates for use with FrameMatchingPredicate. | 233 // Predicates for use with FrameMatchingPredicate. |
| 234 bool FrameMatchesName(const std::string& name, RenderFrameHost* frame); | 234 bool FrameMatchesName(const std::string& name, RenderFrameHost* frame); |
| 235 bool FrameIsChildOfMainFrame(RenderFrameHost* frame); | 235 bool FrameIsChildOfMainFrame(RenderFrameHost* frame); |
| 236 bool FrameHasSourceUrl(const GURL& url, RenderFrameHost* frame); | 236 bool FrameHasSourceUrl(const GURL& url, RenderFrameHost* frame); |
| 237 | 237 |
| 238 // Finds the child frame at the specified |index| for |frame| and returns its | |
| 239 // RenderFrameHost. Returns nullptr if such child frame does not exist. | |
| 240 RenderFrameHost* ChildFrameAt(RenderFrameHost* frame, size_t index); | |
|
alexmos
2016/04/05 16:16:56
I thought this might be useful more generally in p
nasko
2016/04/08 18:29:20
How would that work without access to the FrameTre
alexmos
2016/04/11 18:37:29
Actually, sorry, I misspoke -- I can't put it in s
nasko
2016/04/11 21:56:45
I find the matching by name is a good way to avoid
| |
| 241 | |
| 238 // Executes the WebUI resource test runner injecting each resource ID in | 242 // Executes the WebUI resource test runner injecting each resource ID in |
| 239 // |js_resource_ids| prior to executing the tests. | 243 // |js_resource_ids| prior to executing the tests. |
| 240 // | 244 // |
| 241 // Returns true if tests ran successfully, false otherwise. | 245 // Returns true if tests ran successfully, false otherwise. |
| 242 bool ExecuteWebUIResourceTest(WebContents* web_contents, | 246 bool ExecuteWebUIResourceTest(WebContents* web_contents, |
| 243 const std::vector<int>& js_resource_ids); | 247 const std::vector<int>& js_resource_ids); |
| 244 | 248 |
| 245 // Returns the cookies for the given url. | 249 // Returns the cookies for the given url. |
| 246 std::string GetCookies(BrowserContext* browser_context, const GURL& url); | 250 std::string GetCookies(BrowserContext* browser_context, const GURL& url); |
| 247 | 251 |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 501 blink::WebInputEvent::Type wait_for_type_; | 505 blink::WebInputEvent::Type wait_for_type_; |
| 502 uint32_t ack_result_; | 506 uint32_t ack_result_; |
| 503 base::Closure quit_; | 507 base::Closure quit_; |
| 504 | 508 |
| 505 DISALLOW_COPY_AND_ASSIGN(InputMsgWatcher); | 509 DISALLOW_COPY_AND_ASSIGN(InputMsgWatcher); |
| 506 }; | 510 }; |
| 507 | 511 |
| 508 } // namespace content | 512 } // namespace content |
| 509 | 513 |
| 510 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ | 514 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ |
| OLD | NEW |