OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/strings/stringprintf.h" | 6 #include "base/strings/stringprintf.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "content/browser/accessibility/browser_accessibility.h" | 8 #include "content/browser/accessibility/browser_accessibility.h" |
9 #include "content/browser/accessibility/browser_accessibility_manager.h" | 9 #include "content/browser/accessibility/browser_accessibility_manager.h" |
10 #include "content/browser/accessibility/browser_accessibility_state_impl.h" | 10 #include "content/browser/accessibility/browser_accessibility_state_impl.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 // It is safe to obtain the root frame tree node here, as it doesn't change. | 70 // It is safe to obtain the root frame tree node here, as it doesn't change. |
71 FrameTreeNode* root = | 71 FrameTreeNode* root = |
72 static_cast<WebContentsImpl*>(shell()->web_contents())-> | 72 static_cast<WebContentsImpl*>(shell()->web_contents())-> |
73 GetFrameTree()->root(); | 73 GetFrameTree()->root(); |
74 | 74 |
75 // Load same-site page into iframe. | 75 // Load same-site page into iframe. |
76 FrameTreeNode* child = root->child_at(0); | 76 FrameTreeNode* child = root->child_at(0); |
77 GURL http_url(test_server()->GetURL("files/title1.html")); | 77 GURL http_url(test_server()->GetURL("files/title1.html")); |
78 NavigateFrameToURL(child, http_url); | 78 NavigateFrameToURL(child, http_url); |
79 | 79 |
80 // These must stay in scope with replace_host. | 80 // Load cross-site page into iframe. |
81 GURL::Replacements replace_host; | 81 GURL::Replacements replace_host; |
82 std::string foo_com("foo.com"); | |
83 | |
84 // Load cross-site page into iframe. | |
85 GURL cross_site_url(test_server()->GetURL("files/title2.html")); | 82 GURL cross_site_url(test_server()->GetURL("files/title2.html")); |
86 replace_host.SetHostStr(foo_com); | 83 replace_host.SetHostStr("foo.com"); |
87 cross_site_url = cross_site_url.ReplaceComponents(replace_host); | 84 cross_site_url = cross_site_url.ReplaceComponents(replace_host); |
88 NavigateFrameToURL(root->child_at(0), cross_site_url); | 85 NavigateFrameToURL(root->child_at(0), cross_site_url); |
89 | 86 |
90 // Ensure that we have created a new process for the subframe. | 87 // Ensure that we have created a new process for the subframe. |
91 ASSERT_EQ(2U, root->child_count()); | 88 ASSERT_EQ(2U, root->child_count()); |
92 SiteInstance* site_instance = child->current_frame_host()->GetSiteInstance(); | 89 SiteInstance* site_instance = child->current_frame_host()->GetSiteInstance(); |
93 EXPECT_NE(shell()->web_contents()->GetSiteInstance(), site_instance); | 90 EXPECT_NE(shell()->web_contents()->GetSiteInstance(), site_instance); |
94 | 91 |
95 // Wait for the accessibility tree from the main frame to load. | 92 // Wait for the accessibility tree from the main frame to load. |
96 // Because we created the AccessibilityNotificationWaiter before accessibility | 93 // Because we created the AccessibilityNotificationWaiter before accessibility |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 BrowserAccessibility* ax_child_frame_static_text = | 153 BrowserAccessibility* ax_child_frame_static_text = |
157 ax_child_frame_group->PlatformGetChild(0); | 154 ax_child_frame_group->PlatformGetChild(0); |
158 EXPECT_EQ(ui::AX_ROLE_STATIC_TEXT, ax_child_frame_static_text->GetRole()); | 155 EXPECT_EQ(ui::AX_ROLE_STATIC_TEXT, ax_child_frame_static_text->GetRole()); |
159 ASSERT_EQ(0U, ax_child_frame_static_text->PlatformChildCount()); | 156 ASSERT_EQ(0U, ax_child_frame_static_text->PlatformChildCount()); |
160 | 157 |
161 // Last, check that the parent of the child frame root is correct. | 158 // Last, check that the parent of the child frame root is correct. |
162 EXPECT_EQ(ax_child_frame_root->GetParent(), ax_scroll_area); | 159 EXPECT_EQ(ax_child_frame_root->GetParent(), ax_scroll_area); |
163 } | 160 } |
164 | 161 |
165 } // namespace content | 162 } // namespace content |
OLD | NEW |