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

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: Attempt to fix compile. 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 7c54aad99df82591c699dca51156a4787fd3fc2c..bb4448fde9c18ce241eee860bde7c29bbf3fe509 100644
--- a/content/browser/frame_host/navigation_controller_impl_unittest.cc
+++ b/content/browser/frame_host/navigation_controller_impl_unittest.cc
@@ -22,6 +22,7 @@
#include "content/browser/site_instance_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/common/frame_messages.h"
+#include "content/common/site_isolation_policy.h"
#include "content/common/ssl_status_serialization.h"
#include "content/common/view_messages.h"
#include "content/public/browser/navigation_details.h"
@@ -2083,9 +2084,8 @@ TEST_F(NavigationControllerTest, NewSubframe) {
EXPECT_EQ(url1, entry->GetURL());
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)) {
+ // Verify subframe entries if they're enabled (e.g. in --site-per-process).
+ if (SiteIsolationPolicy::UseSubframeNavigationEntries()) {
// 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,9 +2141,8 @@ TEST_F(NavigationControllerTest, AutoSubframe) {
FrameNavigationEntry* root_entry = entry->root_node()->frame_entry.get();
EXPECT_EQ(url1, root_entry->url());
- // Verify subframe entries if we're in --site-per-process mode.
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kSitePerProcess)) {
+ // Verify subframe entries if they're enabled (e.g. in --site-per-process).
+ if (SiteIsolationPolicy::UseSubframeNavigationEntries()) {
// The entry should now have a subframe FrameNavigationEntry.
ASSERT_EQ(1U, entry->root_node()->children.size());
FrameNavigationEntry* frame_entry =
@@ -2187,9 +2186,8 @@ TEST_F(NavigationControllerTest, AutoSubframe) {
EXPECT_EQ(root_entry, entry->root_node()->frame_entry.get());
EXPECT_EQ(url1, root_entry->url());
- // Verify subframe entries if we're in --site-per-process mode.
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kSitePerProcess)) {
+ // Verify subframe entries if they're enabled (e.g. in --site-per-process).
+ if (SiteIsolationPolicy::UseSubframeNavigationEntries()) {
// The entry should now have 2 subframe FrameNavigationEntries.
ASSERT_EQ(2U, entry->root_node()->children.size());
FrameNavigationEntry* new_frame_entry =
@@ -2237,9 +2235,8 @@ TEST_F(NavigationControllerTest, AutoSubframe) {
EXPECT_EQ(root_entry, entry->root_node()->frame_entry.get());
EXPECT_EQ(url1, root_entry->url());
- // Verify subframe entries if we're in --site-per-process mode.
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kSitePerProcess)) {
+ // Verify subframe entries if they're enabled (e.g. in --site-per-process).
+ if (SiteIsolationPolicy::UseSubframeNavigationEntries()) {
// 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,9 +2308,8 @@ TEST_F(NavigationControllerTest, BackSubframe) {
navigation_entry_committed_counter_ = 0;
EXPECT_EQ(2, controller.GetEntryCount());
- // Verify subframe entries if we're in --site-per-process mode.
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kSitePerProcess)) {
+ // Verify subframe entries if they're enabled (e.g. in --site-per-process).
+ if (SiteIsolationPolicy::UseSubframeNavigationEntries()) {
// 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,9 +2332,8 @@ TEST_F(NavigationControllerTest, BackSubframe) {
EXPECT_EQ(3, controller.GetEntryCount());
EXPECT_EQ(2, controller.GetCurrentEntryIndex());
- // Verify subframe entries if we're in --site-per-process mode.
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kSitePerProcess)) {
+ // Verify subframe entries if they're enabled (e.g. in --site-per-process).
+ if (SiteIsolationPolicy::UseSubframeNavigationEntries()) {
// 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());
« no previous file with comments | « content/browser/frame_host/navigation_controller_impl_browsertest.cc ('k') | content/browser/frame_host/navigator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698