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/basictypes.h" | 16 #include "base/basictypes.h" |
17 | 17 |
18 class GURL; | 18 class GURL; |
19 | 19 |
20 namespace content { | 20 namespace content { |
21 | 21 |
22 class FrameTreeNode; | 22 class FrameTreeNode; |
| 23 class Shell; |
23 class SiteInstance; | 24 class SiteInstance; |
| 25 class ToRenderFrameHost; |
24 | 26 |
25 // Navigates the frame represented by |node| to |url|, blocking until the | 27 // Navigates the frame represented by |node| to |url|, blocking until the |
26 // navigation finishes. | 28 // navigation finishes. |
27 void NavigateFrameToURL(FrameTreeNode* node, const GURL& url); | 29 void NavigateFrameToURL(FrameTreeNode* node, const GURL& url); |
28 | 30 |
29 // Creates compact textual representations of the state of the frame tree that | 31 // Creates compact textual representations of the state of the frame tree that |
30 // is appropriate for use in assertions. | 32 // is appropriate for use in assertions. |
31 // | 33 // |
32 // The diagrams show frame tree structure, the SiteInstance of current frames, | 34 // The diagrams show frame tree structure, the SiteInstance of current frames, |
33 // presence of pending frames, and the SiteInstances of any and all proxies. | 35 // presence of pending frames, and the SiteInstances of any and all proxies. |
(...skipping 24 matching lines...) Expand all Loading... |
58 // Assign or retrive the abbreviated short name (A, B, C) for a site instance. | 60 // Assign or retrive the abbreviated short name (A, B, C) for a site instance. |
59 std::string GetName(SiteInstance* site_instance); | 61 std::string GetName(SiteInstance* site_instance); |
60 | 62 |
61 // Elements are site instance ids. The index of the SiteInstance in the vector | 63 // Elements are site instance ids. The index of the SiteInstance in the vector |
62 // determines the abbreviated name (0->A, 1->B) for that SiteInstance. | 64 // determines the abbreviated name (0->A, 1->B) for that SiteInstance. |
63 std::vector<int> seen_site_instance_ids_; | 65 std::vector<int> seen_site_instance_ids_; |
64 | 66 |
65 DISALLOW_COPY_AND_ASSIGN(FrameTreeVisualizer); | 67 DISALLOW_COPY_AND_ASSIGN(FrameTreeVisualizer); |
66 }; | 68 }; |
67 | 69 |
| 70 // Uses window.open to open a popup from the frame |opener| with the specified |
| 71 // |url| and |name|. Waits for the navigation to |url| to finish and then |
| 72 // returns the new popup's Shell. Note that since this navigation to |url| is |
| 73 // renderer-initiated, it won't cause a process swap unless used in |
| 74 // --site-per-process mode. |
| 75 Shell* OpenPopup(const ToRenderFrameHost& opener, |
| 76 const GURL& url, |
| 77 const std::string& name); |
| 78 |
68 } // namespace content | 79 } // namespace content |
69 | 80 |
70 #endif // CONTENT_TEST_CONTENT_BROWSER_TEST_UTILS_INTERNAL_H_ | 81 #endif // CONTENT_TEST_CONTENT_BROWSER_TEST_UTILS_INTERNAL_H_ |
OLD | NEW |