Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Side by Side Diff: content/browser/renderer_host/render_view_host_manager_browsertest.cc

Issue 19625003: Fix 'RenderViewHostManagerTest.NoScriptAccessAfterSwapOut'. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/test/data/click-noreferrer-links.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "base/json/json_reader.h" 5 #include "base/json/json_reader.h"
6 #include "base/memory/ref_counted.h" 6 #include "base/memory/ref_counted.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "content/browser/renderer_host/render_view_host_impl.h" 10 #include "content/browser/renderer_host/render_view_host_impl.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 std::vector<net::SpawnedTestServer::StringPair> replacement_text; 44 std::vector<net::SpawnedTestServer::StringPair> replacement_text;
45 replacement_text.push_back( 45 replacement_text.push_back(
46 make_pair("REPLACE_WITH_HOST_AND_PORT", host_port_pair.ToString())); 46 make_pair("REPLACE_WITH_HOST_AND_PORT", host_port_pair.ToString()));
47 return net::SpawnedTestServer::GetFilePathWithReplacements( 47 return net::SpawnedTestServer::GetFilePathWithReplacements(
48 original_file_path, replacement_text, replacement_path); 48 original_file_path, replacement_text, replacement_path);
49 } 49 }
50 }; 50 };
51 51
52 // Web pages should not have script access to the swapped out page. 52 // Web pages should not have script access to the swapped out page.
53 IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest, 53 IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest,
54 DISABLED_NoScriptAccessAfterSwapOut) { 54 NoScriptAccessAfterSwapOut) {
55 // Start two servers with different sites. 55 // Start two servers with different sites.
56 ASSERT_TRUE(test_server()->Start()); 56 ASSERT_TRUE(test_server()->Start());
57 net::SpawnedTestServer https_server( 57 net::SpawnedTestServer https_server(
58 net::SpawnedTestServer::TYPE_HTTPS, 58 net::SpawnedTestServer::TYPE_HTTPS,
59 net::SpawnedTestServer::kLocalhost, 59 net::SpawnedTestServer::kLocalhost,
60 base::FilePath(FILE_PATH_LITERAL("content/test/data"))); 60 base::FilePath(FILE_PATH_LITERAL("content/test/data")));
61 ASSERT_TRUE(https_server.Start()); 61 ASSERT_TRUE(https_server.Start());
62 62
63 // Load a page with links that open in a new window. 63 // Load a page with links that open in a new window.
64 std::string replacement_path; 64 std::string replacement_path;
(...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1284 NavigateToURL(shell(), https_server.GetURL("files/title1.html")); 1284 NavigateToURL(shell(), https_server.GetURL("files/title1.html"));
1285 1285
1286 // Make sure it ends up at the right page. 1286 // Make sure it ends up at the right page.
1287 WaitForLoadStop(shell()->web_contents()); 1287 WaitForLoadStop(shell()->web_contents());
1288 EXPECT_EQ(https_server.GetURL("files/title1.html"), 1288 EXPECT_EQ(https_server.GetURL("files/title1.html"),
1289 shell()->web_contents()->GetURL()); 1289 shell()->web_contents()->GetURL());
1290 EXPECT_EQ(new_site_instance, shell()->web_contents()->GetSiteInstance()); 1290 EXPECT_EQ(new_site_instance, shell()->web_contents()->GetSiteInstance());
1291 } 1291 }
1292 1292
1293 } // namespace content 1293 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/test/data/click-noreferrer-links.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698