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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
62 #define MAYBE_CrossSiteIframeAccessibility DISABLED_CrossSiteIframeAccessibility | 62 #define MAYBE_CrossSiteIframeAccessibility DISABLED_CrossSiteIframeAccessibility |
63 #else | 63 #else |
64 #define MAYBE_CrossSiteIframeAccessibility CrossSiteIframeAccessibility | 64 #define MAYBE_CrossSiteIframeAccessibility CrossSiteIframeAccessibility |
65 #endif | 65 #endif |
66 IN_PROC_BROWSER_TEST_F(SitePerProcessAccessibilityBrowserTest, | 66 IN_PROC_BROWSER_TEST_F(SitePerProcessAccessibilityBrowserTest, |
67 MAYBE_CrossSiteIframeAccessibility) { | 67 MAYBE_CrossSiteIframeAccessibility) { |
68 // Enable full accessibility for all current and future WebContents. | 68 // Enable full accessibility for all current and future WebContents. |
69 BrowserAccessibilityState::GetInstance()->EnableAccessibility(); | 69 BrowserAccessibilityState::GetInstance()->EnableAccessibility(); |
70 | 70 |
71 host_resolver()->AddRule("*", "127.0.0.1"); | 71 host_resolver()->AddRule("*", "127.0.0.1"); |
72 ASSERT_TRUE(test_server()->Start()); | 72 GURL main_url(embedded_test_server()->GetURL("/site_per_process_main.html")); |
mmenke
2015/11/03 19:12:57
Should include embedded_test_server.h.
svaldez
2015/11/03 19:33:15
Done.
| |
73 GURL main_url(test_server()->GetURL("files/site_per_process_main.html")); | |
74 NavigateToURL(shell(), main_url); | 73 NavigateToURL(shell(), main_url); |
75 | 74 |
76 // It is safe to obtain the root frame tree node here, as it doesn't change. | 75 // It is safe to obtain the root frame tree node here, as it doesn't change. |
77 FrameTreeNode* root = | 76 FrameTreeNode* root = |
78 static_cast<WebContentsImpl*>(shell()->web_contents())-> | 77 static_cast<WebContentsImpl*>(shell()->web_contents())-> |
79 GetFrameTree()->root(); | 78 GetFrameTree()->root(); |
80 | 79 |
81 // Load same-site page into iframe. | 80 // Load same-site page into iframe. |
82 FrameTreeNode* child = root->child_at(0); | 81 FrameTreeNode* child = root->child_at(0); |
83 GURL http_url(test_server()->GetURL("files/title1.html")); | 82 GURL http_url(embedded_test_server()->GetURL("/title1.html")); |
84 NavigateFrameToURL(child, http_url); | 83 NavigateFrameToURL(child, http_url); |
85 | 84 |
86 // Load cross-site page into iframe. | 85 // Load cross-site page into iframe. |
87 RenderFrameHostImpl* child_rfh = | 86 RenderFrameHostImpl* child_rfh = |
88 child->render_manager()->current_frame_host(); | 87 child->render_manager()->current_frame_host(); |
89 RenderFrameDeletedObserver deleted_observer(child_rfh); | 88 RenderFrameDeletedObserver deleted_observer(child_rfh); |
90 GURL::Replacements replace_host; | 89 GURL::Replacements replace_host; |
91 GURL cross_site_url(test_server()->GetURL("files/title2.html")); | 90 GURL cross_site_url(embedded_test_server()->GetURL("/title2.html")); |
92 replace_host.SetHostStr("foo.com"); | 91 replace_host.SetHostStr("foo.com"); |
93 cross_site_url = cross_site_url.ReplaceComponents(replace_host); | 92 cross_site_url = cross_site_url.ReplaceComponents(replace_host); |
94 NavigateFrameToURL(root->child_at(0), cross_site_url); | 93 NavigateFrameToURL(root->child_at(0), cross_site_url); |
95 | 94 |
96 // Ensure that we have created a new process for the subframe. | 95 // Ensure that we have created a new process for the subframe. |
97 ASSERT_EQ(2U, root->child_count()); | 96 ASSERT_EQ(2U, root->child_count()); |
98 SiteInstance* site_instance = child->current_frame_host()->GetSiteInstance(); | 97 SiteInstance* site_instance = child->current_frame_host()->GetSiteInstance(); |
99 EXPECT_NE(shell()->web_contents()->GetSiteInstance(), site_instance); | 98 EXPECT_NE(shell()->web_contents()->GetSiteInstance(), site_instance); |
100 | 99 |
101 // Wait until the iframe completes the swap. | 100 // Wait until the iframe completes the swap. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
146 BrowserAccessibility* ax_child_frame_static_text = | 145 BrowserAccessibility* ax_child_frame_static_text = |
147 ax_child_frame_group->PlatformGetChild(0); | 146 ax_child_frame_group->PlatformGetChild(0); |
148 EXPECT_EQ(ui::AX_ROLE_STATIC_TEXT, ax_child_frame_static_text->GetRole()); | 147 EXPECT_EQ(ui::AX_ROLE_STATIC_TEXT, ax_child_frame_static_text->GetRole()); |
149 ASSERT_EQ(0U, ax_child_frame_static_text->PlatformChildCount()); | 148 ASSERT_EQ(0U, ax_child_frame_static_text->PlatformChildCount()); |
150 | 149 |
151 // Last, check that the parent of the child frame root is correct. | 150 // Last, check that the parent of the child frame root is correct. |
152 EXPECT_EQ(ax_child_frame_root->GetParent(), ax_iframe); | 151 EXPECT_EQ(ax_child_frame_root->GetParent(), ax_iframe); |
153 } | 152 } |
154 | 153 |
155 } // namespace content | 154 } // namespace content |
OLD | NEW |