Chromium Code Reviews| Index: content/browser/frame_host/navigation_controller_impl_browsertest.cc |
| diff --git a/content/browser/frame_host/navigation_controller_impl_browsertest.cc b/content/browser/frame_host/navigation_controller_impl_browsertest.cc |
| index 5cd628898f60a50d9dc838872df503e3c2d95865..05d4a1e32d95172bd715a4fc0c8ba482ef9c393c 100644 |
| --- a/content/browser/frame_host/navigation_controller_impl_browsertest.cc |
| +++ b/content/browser/frame_host/navigation_controller_impl_browsertest.cc |
| @@ -3,7 +3,6 @@ |
| // found in the LICENSE file. |
| #include "base/bind.h" |
| -#include "base/command_line.h" |
| #include "base/strings/stringprintf.h" |
| #include "base/strings/utf_string_conversions.h" |
| #include "content/browser/frame_host/frame_navigation_entry.h" |
| @@ -19,7 +18,6 @@ |
| #include "content/public/browser/web_contents.h" |
| #include "content/public/browser/web_contents_observer.h" |
| #include "content/public/common/bindings_policy.h" |
| -#include "content/public/common/content_switches.h" |
| #include "content/public/common/url_constants.h" |
| #include "content/public/test/browser_test_utils.h" |
| #include "content/public/test/content_browser_test.h" |
| @@ -64,8 +62,7 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, LoadCrossSiteSubframe) { |
| // We should only have swapped processes in --site-per-process. |
| bool cross_process = root->current_frame_host()->GetProcess() != |
| root->child_at(0)->current_frame_host()->GetProcess(); |
| - EXPECT_EQ(base::CommandLine::ForCurrentProcess()->HasSwitch( |
| - switches::kSitePerProcess), |
| + EXPECT_EQ(AreAllSitesIsolatedForTesting(), |
| cross_process); |
| } |
| @@ -1211,8 +1208,7 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, |
| EXPECT_EQ(entry, controller.GetLastCommittedEntry()); |
| // Verify subframe entries if we're in --site-per-process mode. |
| - if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| - switches::kSitePerProcess)) { |
| + if (AreAllSitesIsolatedForTesting()) { |
|
Charlie Reis
2015/07/21 16:58:23
On second thought, this is UseSubframeNavigationEn
ncarter (slow)
2015/07/22 23:29:08
Done. I didn't actually switch over the FrameTreeV
|
| // The entry should now have one subframe FrameNavigationEntry. |
| ASSERT_EQ(1U, entry->root_node()->children.size()); |
| FrameNavigationEntry* frame_entry = |
| @@ -1242,8 +1238,7 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, |
| EXPECT_EQ(entry, controller.GetLastCommittedEntry()); |
| // Verify subframe entries if we're in --site-per-process mode. |
| - if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| - switches::kSitePerProcess)) { |
| + if (AreAllSitesIsolatedForTesting()) { |
| // The entry should now have two subframe FrameNavigationEntries. |
| ASSERT_EQ(2U, entry->root_node()->children.size()); |
| FrameNavigationEntry* frame_entry = |
| @@ -1256,8 +1251,7 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, |
| } |
| // Check the end result of the frame tree. |
| - if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| - switches::kSitePerProcess)) { |
| + if (AreAllSitesIsolatedForTesting()) { |
| FrameTreeVisualizer visualizer; |
| EXPECT_EQ( |
| " Site A ------------ proxies for B\n" |
| @@ -1306,8 +1300,7 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, |
| EXPECT_FALSE(controller.GetPendingEntry()); |
| // Verify subframe entries if we're in --site-per-process mode. |
| - if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| - switches::kSitePerProcess)) { |
| + if (AreAllSitesIsolatedForTesting()) { |
| // The entry should now have a subframe FrameNavigationEntry. |
| ASSERT_EQ(1U, entry->root_node()->children.size()); |
| FrameNavigationEntry* frame_entry = |
| @@ -1341,8 +1334,7 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, |
| EXPECT_FALSE(controller.GetPendingEntry()); |
| // Verify subframe entries if we're in --site-per-process mode. |
| - if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| - switches::kSitePerProcess)) { |
| + if (AreAllSitesIsolatedForTesting()) { |
| // The entry should now have 2 subframe FrameNavigationEntries. |
| ASSERT_EQ(2U, entry->root_node()->children.size()); |
| FrameNavigationEntry* frame_entry = |
| @@ -1374,8 +1366,7 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, |
| EXPECT_EQ(main_url, root_entry->url()); |
| // Verify subframe entries if we're in --site-per-process mode. |
| - if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| - switches::kSitePerProcess)) { |
| + if (AreAllSitesIsolatedForTesting()) { |
| // The entry should now have 2 subframe FrameNavigationEntries. |
| ASSERT_EQ(2U, entry->root_node()->children.size()); |
| ASSERT_EQ(1U, entry->root_node()->children[1]->children.size()); |
| @@ -1391,8 +1382,7 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, |
| // within it. Both are currently broken. |
| // Check the end result of the frame tree. |
| - if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| - switches::kSitePerProcess)) { |
| + if (AreAllSitesIsolatedForTesting()) { |
| FrameTreeVisualizer visualizer; |
| EXPECT_EQ( |
| " Site A ------------ proxies for B\n" |
| @@ -1454,8 +1444,7 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, |
| EXPECT_EQ(main_url, root_entry2->url()); |
| // Verify subframe entries if we're in --site-per-process mode. |
| - if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| - switches::kSitePerProcess)) { |
| + if (AreAllSitesIsolatedForTesting()) { |
| // The entry should have a new FrameNavigationEntries for the subframe. |
| ASSERT_EQ(1U, entry2->root_node()->children.size()); |
| EXPECT_EQ(frame_url2, entry2->root_node()->children[0]->frame_entry->url()); |
| @@ -1508,8 +1497,7 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, |
| EXPECT_EQ(main_url, root_entry3->url()); |
| // Verify subframe entries if we're in --site-per-process mode. |
| - if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| - switches::kSitePerProcess)) { |
| + if (AreAllSitesIsolatedForTesting()) { |
| // The entry should still have FrameNavigationEntries for all 3 subframes. |
| ASSERT_EQ(2U, entry3->root_node()->children.size()); |
| EXPECT_EQ(frame_url2, entry3->root_node()->children[0]->frame_entry->url()); |
| @@ -1547,8 +1535,7 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, |
| EXPECT_EQ(main_url, root_entry4->url()); |
| // Verify subframe entries if we're in --site-per-process mode. |
| - if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| - switches::kSitePerProcess)) { |
| + if (AreAllSitesIsolatedForTesting()) { |
| // The entry should still have FrameNavigationEntries for all 3 subframes. |
| ASSERT_EQ(2U, entry4->root_node()->children.size()); |
| EXPECT_EQ(frame_url2, entry4->root_node()->children[0]->frame_entry->url()); |
| @@ -1560,8 +1547,7 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, |
| } |
| // Check the end result of the frame tree. |
| - if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| - switches::kSitePerProcess)) { |
| + if (AreAllSitesIsolatedForTesting()) { |
| FrameTreeVisualizer visualizer; |
| EXPECT_EQ( |
| " Site A ------------ proxies for B\n" |
| @@ -1637,8 +1623,7 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, |
| EXPECT_EQ(entry2, controller.GetLastCommittedEntry()); |
| // Verify subframe entries if we're in --site-per-process mode. |
| - if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| - switches::kSitePerProcess)) { |
| + if (AreAllSitesIsolatedForTesting()) { |
| // The entry should have a new FrameNavigationEntries for the subframe. |
| ASSERT_EQ(1U, entry2->root_node()->children.size()); |
| EXPECT_EQ(frame_url2, entry2->root_node()->children[0]->frame_entry->url()); |
| @@ -1660,8 +1645,7 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, |
| EXPECT_EQ(entry1, controller.GetLastCommittedEntry()); |
| // Verify subframe entries if we're in --site-per-process mode. |
| - if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| - switches::kSitePerProcess)) { |
| + if (AreAllSitesIsolatedForTesting()) { |
| // The entry should have a new FrameNavigationEntries for the subframe. |
| ASSERT_EQ(1U, entry1->root_node()->children.size()); |
| EXPECT_EQ(frame_url, entry1->root_node()->children[0]->frame_entry->url()); |
| @@ -1683,8 +1667,7 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, |
| EXPECT_EQ(entry2, controller.GetLastCommittedEntry()); |
| // Verify subframe entries if we're in --site-per-process mode. |
| - if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| - switches::kSitePerProcess)) { |
| + if (AreAllSitesIsolatedForTesting()) { |
| // The entry should have a new FrameNavigationEntries for the subframe. |
| ASSERT_EQ(1U, entry2->root_node()->children.size()); |
| EXPECT_EQ(frame_url2, entry2->root_node()->children[0]->frame_entry->url()); |
| @@ -1706,8 +1689,7 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, |
| EXPECT_EQ(entry3, controller.GetLastCommittedEntry()); |
| // Verify subframe entries if we're in --site-per-process mode. |
| - if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| - switches::kSitePerProcess)) { |
| + if (AreAllSitesIsolatedForTesting()) { |
| // The entry should have a new FrameNavigationEntries for the subframe. |
| ASSERT_EQ(1U, entry3->root_node()->children.size()); |
| EXPECT_EQ(frame_url3, entry3->root_node()->children[0]->frame_entry->url()); |
| @@ -1754,8 +1736,7 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, |
| // Also test subframe sequence numbers, but only in --site-per-proces mode. |
| // (We do not create subframe FrameNavigationEntries in default mode yet.) |
| - if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| - switches::kSitePerProcess)) |
| + if (!AreAllSitesIsolatedForTesting()) |
| return; |
| // 3. Add a subframe, which does an AUTO_SUBFRAME navigation. |