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

Side by Side Diff: content/browser/frame_host/render_frame_host_manager_browsertest.cc

Issue 659293002: Make sure new render is used when navigating away from about:blank in WebUI renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved the implementation to the better places pointed out and addressed other comments. Created 6 years, 2 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <set> 5 #include <set>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 1455 matching lines...) Expand 10 before | Expand all | Expand 10 after
1466 1466
1467 // Navigate to url1 and check bindings. 1467 // Navigate to url1 and check bindings.
1468 NavigateToURL(new_shell, url1); 1468 NavigateToURL(new_shell, url1);
1469 // The navigation should have used the first SiteInstance, otherwise 1469 // The navigation should have used the first SiteInstance, otherwise
1470 // |initial_rvh| did not have a chance to be used. 1470 // |initial_rvh| did not have a chance to be used.
1471 EXPECT_EQ(new_web_contents->GetSiteInstance(), site_instance1); 1471 EXPECT_EQ(new_web_contents->GetSiteInstance(), site_instance1);
1472 EXPECT_EQ(BINDINGS_POLICY_WEB_UI, 1472 EXPECT_EQ(BINDINGS_POLICY_WEB_UI,
1473 new_web_contents->GetRenderViewHost()->GetEnabledBindings()); 1473 new_web_contents->GetRenderViewHost()->GetEnabledBindings());
1474 } 1474 }
1475 1475
1476 // crbug.com/424526
1477 // The test loads WebUI page, then navigates to blank page and to the regular
Charlie Reis 2014/10/21 19:10:41 nit: loads a WebUI page in --process-per-tab mode,
Krzysztof Olczyk 2014/10/22 06:24:05 Done.
1478 // page, consecutively. The bug reproduces if blank page is navigated in between
Charlie Reis 2014/10/21 19:10:42 nit: navigated -> visited
Krzysztof Olczyk 2014/10/22 06:24:05 Done.
1479 // WebUI and regular page.
1480 IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest,
1481 ForceSwapAfterWebUIBindings) {
1482 CommandLine::ForCurrentProcess()->AppendSwitch(switches::kProcessPerTab);
1483 ASSERT_TRUE(test_server()->Start());
1484
1485 const GURL web_ui_url(std::string(kChromeUIScheme) + "://" +
1486 std::string(kChromeUIGpuHost));
1487 NavigateToURL(shell(), web_ui_url);
1488 EXPECT_TRUE(ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings(
1489 shell()->web_contents()->GetRenderProcessHost()->GetID()));
1490
1491 NavigateToURL(shell(), GURL(url::kAboutBlankURL));
1492
1493 GURL regular_page_url(test_server()->GetURL("files/title2.html"));
1494 NavigateToURL(shell(), regular_page_url);
1495 EXPECT_FALSE(ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings(
1496 shell()->web_contents()->GetRenderProcessHost()->GetID()));
1497 }
1498
1476 } // namespace content 1499 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698