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

Unified Diff: content/browser/frame_host/navigation_controller_impl_unittest.cc

Issue 1208143002: Move existing kSitePerProcess checks to a policy-oracle object (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@swapped_out_cmdline_checks
Patch Set: Partial fixes to Nasko's comments. Created 5 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/frame_host/navigation_controller_impl_unittest.cc
diff --git a/content/browser/frame_host/navigation_controller_impl_unittest.cc b/content/browser/frame_host/navigation_controller_impl_unittest.cc
index 1520c031a50a64ac69c377addf9f26fb664ee273..6303b067c417822260621d26496c8d881f0237ed 100644
--- a/content/browser/frame_host/navigation_controller_impl_unittest.cc
+++ b/content/browser/frame_host/navigation_controller_impl_unittest.cc
@@ -32,6 +32,7 @@
#include "content/public/common/content_switches.h"
#include "content/public/common/page_state.h"
#include "content/public/common/page_type.h"
+#include "content/public/common/site_isolation_policy.h"
#include "content/public/common/url_constants.h"
#include "content/public/test/mock_render_process_host.h"
#include "content/public/test/test_notification_tracker.h"
@@ -2083,8 +2084,7 @@ TEST_F(NavigationControllerTest, NewSubframe) {
EXPECT_EQ(params.page_id, entry->GetPageID());
// Verify subframe entries if we're in --site-per-process mode.
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kSitePerProcess)) {
+ if (SiteIsolationPolicy::AreAllSitesIsolatedForTesting()) {
// The entry should have a subframe FrameNavigationEntry.
ASSERT_EQ(1U, entry->root_node()->children.size());
EXPECT_EQ(url2, entry->root_node()->children[0]->frame_entry->url());
@@ -2141,8 +2141,7 @@ TEST_F(NavigationControllerTest, AutoSubframe) {
EXPECT_EQ(url1, root_entry->url());
// Verify subframe entries if we're in --site-per-process mode.
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kSitePerProcess)) {
+ if (SiteIsolationPolicy::AreAllSitesIsolatedForTesting()) {
// The entry should now have a subframe FrameNavigationEntry.
ASSERT_EQ(1U, entry->root_node()->children.size());
FrameNavigationEntry* frame_entry =
@@ -2187,8 +2186,7 @@ TEST_F(NavigationControllerTest, AutoSubframe) {
EXPECT_EQ(url1, root_entry->url());
// Verify subframe entries if we're in --site-per-process mode.
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kSitePerProcess)) {
+ if (SiteIsolationPolicy::AreAllSitesIsolatedForTesting()) {
// The entry should now have 2 subframe FrameNavigationEntries.
ASSERT_EQ(2U, entry->root_node()->children.size());
FrameNavigationEntry* new_frame_entry =
@@ -2237,8 +2235,7 @@ TEST_F(NavigationControllerTest, AutoSubframe) {
EXPECT_EQ(url1, root_entry->url());
// Verify subframe entries if we're in --site-per-process mode.
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kSitePerProcess)) {
+ if (SiteIsolationPolicy::AreAllSitesIsolatedForTesting()) {
// The entry should now have a nested FrameNavigationEntry.
EXPECT_EQ(2U, entry->root_node()->children.size());
ASSERT_EQ(1U, entry->root_node()->children[0]->children.size());
@@ -2311,8 +2308,7 @@ TEST_F(NavigationControllerTest, BackSubframe) {
EXPECT_EQ(2, controller.GetEntryCount());
// Verify subframe entries if we're in --site-per-process mode.
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kSitePerProcess)) {
+ if (SiteIsolationPolicy::AreAllSitesIsolatedForTesting()) {
// The entry should have a subframe FrameNavigationEntry.
ASSERT_EQ(1U, entry2->root_node()->children.size());
EXPECT_EQ(url2, entry2->root_node()->children[0]->frame_entry->url());
@@ -2336,8 +2332,7 @@ TEST_F(NavigationControllerTest, BackSubframe) {
EXPECT_EQ(2, controller.GetCurrentEntryIndex());
// Verify subframe entries if we're in --site-per-process mode.
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kSitePerProcess)) {
+ if (SiteIsolationPolicy::AreAllSitesIsolatedForTesting()) {
// The entry should have a subframe FrameNavigationEntry.
ASSERT_EQ(1U, entry3->root_node()->children.size());
EXPECT_EQ(url3, entry3->root_node()->children[0]->frame_entry->url());

Powered by Google App Engine
This is Rietveld 408576698