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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 bool ExecuteScriptAndExtractInt(const ToRenderFrameHost& adapter, | 187 bool ExecuteScriptAndExtractInt(const ToRenderFrameHost& adapter, |
188 const std::string& script, | 188 const std::string& script, |
189 int* result) WARN_UNUSED_RESULT; | 189 int* result) WARN_UNUSED_RESULT; |
190 bool ExecuteScriptAndExtractBool(const ToRenderFrameHost& adapter, | 190 bool ExecuteScriptAndExtractBool(const ToRenderFrameHost& adapter, |
191 const std::string& script, | 191 const std::string& script, |
192 bool* result) WARN_UNUSED_RESULT; | 192 bool* result) WARN_UNUSED_RESULT; |
193 bool ExecuteScriptAndExtractString(const ToRenderFrameHost& adapter, | 193 bool ExecuteScriptAndExtractString(const ToRenderFrameHost& adapter, |
194 const std::string& script, | 194 const std::string& script, |
195 std::string* result) WARN_UNUSED_RESULT; | 195 std::string* result) WARN_UNUSED_RESULT; |
196 | 196 |
| 197 // This function behaves similarly to ExecuteScriptAndExtractBool but runs the |
| 198 // the script in the specified isolated world. |
| 199 bool ExecuteScriptInIsolatedWorldAndExtractBool( |
| 200 const ToRenderFrameHost& adapter, |
| 201 const int world_id, |
| 202 const std::string& script, |
| 203 bool* result) WARN_UNUSED_RESULT; |
| 204 |
197 // Walks the frame tree of the specified WebContents and returns the sole frame | 205 // Walks the frame tree of the specified WebContents and returns the sole frame |
198 // that matches the specified predicate function. This function will DCHECK if | 206 // that matches the specified predicate function. This function will DCHECK if |
199 // no frames match the specified predicate, or if more than one frame matches. | 207 // no frames match the specified predicate, or if more than one frame matches. |
200 RenderFrameHost* FrameMatchingPredicate( | 208 RenderFrameHost* FrameMatchingPredicate( |
201 WebContents* web_contents, | 209 WebContents* web_contents, |
202 const base::Callback<bool(RenderFrameHost*)>& predicate); | 210 const base::Callback<bool(RenderFrameHost*)>& predicate); |
203 | 211 |
204 // Predicates for use with FrameMatchingPredicate. | 212 // Predicates for use with FrameMatchingPredicate. |
205 bool FrameMatchesName(const std::string& name, RenderFrameHost* frame); | 213 bool FrameMatchesName(const std::string& name, RenderFrameHost* frame); |
206 bool FrameIsChildOfMainFrame(RenderFrameHost* frame); | 214 bool FrameIsChildOfMainFrame(RenderFrameHost* frame); |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 | 418 |
411 int frames_to_wait_; | 419 int frames_to_wait_; |
412 base::Closure quit_; | 420 base::Closure quit_; |
413 | 421 |
414 DISALLOW_COPY_AND_ASSIGN(FrameWatcher); | 422 DISALLOW_COPY_AND_ASSIGN(FrameWatcher); |
415 }; | 423 }; |
416 | 424 |
417 } // namespace content | 425 } // namespace content |
418 | 426 |
419 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ | 427 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ |
OLD | NEW |