Chromium Code Reviews| Index: content/browser/cross_site_transfer_browsertest.cc |
| diff --git a/content/browser/cross_site_transfer_browsertest.cc b/content/browser/cross_site_transfer_browsertest.cc |
| index 9fc91a588a162b1d91f8b37d89a8372e18a61676..3c84756e25e68132e79e45f850a00837cd15f639 100644 |
| --- a/content/browser/cross_site_transfer_browsertest.cc |
| +++ b/content/browser/cross_site_transfer_browsertest.cc |
| @@ -17,6 +17,7 @@ |
| #include "content/public/browser/resource_dispatcher_host_delegate.h" |
| #include "content/public/browser/resource_throttle.h" |
| #include "content/public/browser/web_contents.h" |
| +#include "content/public/common/content_switches.h" |
| #include "content/public/test/browser_test_utils.h" |
| #include "content/public/test/content_browser_test.h" |
| #include "content/public/test/content_browser_test_utils.h" |
| @@ -165,7 +166,14 @@ class NoTransferRequestDelegate : public WebContentsDelegate { |
| DISALLOW_COPY_AND_ASSIGN(NoTransferRequestDelegate); |
| }; |
| -class CrossSiteTransferTest : public ContentBrowserTest { |
| +enum class TestParameter { |
| + LOADING_WITHOUT_MOJO, |
| + LOADING_WITH_MOJO, |
| +}; |
| + |
| +class CrossSiteTransferTest |
| + : public ContentBrowserTest, |
| + public ::testing::WithParamInterface<TestParameter> { |
| public: |
| CrossSiteTransferTest() : old_delegate_(nullptr) {} |
| @@ -207,6 +215,10 @@ class CrossSiteTransferTest : public ContentBrowserTest { |
| void SetUpCommandLine(base::CommandLine* command_line) override { |
| IsolateAllSitesForTesting(command_line); |
| + if (GetParam() == TestParameter::LOADING_WITH_MOJO) { |
| + command_line->AppendSwitchASCII(switches::kEnableBlinkFeatures, |
|
clamy
2016/11/16 16:38:53
If this is used in several places, it could be abs
yhirano
2016/11/17 15:23:19
This is the first time we are doing this.
|
| + "LoadingWithMojo"); |
| + } |
| } |
| void InjectResourceDispatcherHostDelegate() { |
| @@ -244,7 +256,7 @@ class CrossSiteTransferTest : public ContentBrowserTest { |
| #endif |
| // Tests that the |should_replace_current_entry| flag persists correctly across |
| // request transfers that began with a cross-process navigation. |
| -IN_PROC_BROWSER_TEST_F(CrossSiteTransferTest, |
| +IN_PROC_BROWSER_TEST_P(CrossSiteTransferTest, |
| MAYBE_ReplaceEntryCrossProcessThenTransfer) { |
| const NavigationController& controller = |
| shell()->web_contents()->GetController(); |
| @@ -303,7 +315,7 @@ IN_PROC_BROWSER_TEST_F(CrossSiteTransferTest, |
| // request transfers that began with a content-initiated in-process |
| // navigation. This test is the same as the test above, except transfering from |
| // in-process. |
| -IN_PROC_BROWSER_TEST_F(CrossSiteTransferTest, |
| +IN_PROC_BROWSER_TEST_P(CrossSiteTransferTest, |
| ReplaceEntryInProcessThenTransfer) { |
| const NavigationController& controller = |
| shell()->web_contents()->GetController(); |
| @@ -344,7 +356,7 @@ IN_PROC_BROWSER_TEST_F(CrossSiteTransferTest, |
| // Tests that the |should_replace_current_entry| flag persists correctly across |
| // request transfers that cross processes twice from renderer policy. |
| -IN_PROC_BROWSER_TEST_F(CrossSiteTransferTest, |
| +IN_PROC_BROWSER_TEST_P(CrossSiteTransferTest, |
| MAYBE_ReplaceEntryCrossProcessTwice) { |
| const NavigationController& controller = |
| shell()->web_contents()->GetController(); |
| @@ -389,7 +401,7 @@ IN_PROC_BROWSER_TEST_F(CrossSiteTransferTest, |
| // Tests that the request is destroyed when a cross process navigation is |
| // cancelled. |
| -IN_PROC_BROWSER_TEST_F(CrossSiteTransferTest, NoLeakOnCrossSiteCancel) { |
| +IN_PROC_BROWSER_TEST_P(CrossSiteTransferTest, NoLeakOnCrossSiteCancel) { |
| const NavigationController& controller = |
| shell()->web_contents()->GetController(); |
| @@ -433,7 +445,7 @@ IN_PROC_BROWSER_TEST_F(CrossSiteTransferTest, NoLeakOnCrossSiteCancel) { |
| // files encapsulated by HTTP POST body that is forwarded to the new renderer. |
| // Invalid handling of this scenario has been suspected as the cause of at least |
| // some of the renderer kills tracked in https://crbug.com/613260. |
| -IN_PROC_BROWSER_TEST_F(CrossSiteTransferTest, PostWithFileData) { |
| +IN_PROC_BROWSER_TEST_P(CrossSiteTransferTest, PostWithFileData) { |
| // Navigate to the page with form that posts via 307 redirection to |
| // |redirect_target_url| (cross-site from |form_url|). Using 307 (rather than |
| // 302) redirection is important to preserve the HTTP method and POST body. |
| @@ -497,4 +509,10 @@ IN_PROC_BROWSER_TEST_F(CrossSiteTransferTest, PostWithFileData) { |
| ::testing::HasSubstr("form-data; name=\"file\"")); |
| } |
| +INSTANTIATE_TEST_CASE_P( |
| + CrossSiteTransferTest, |
| + CrossSiteTransferTest, |
| + ::testing::Values(TestParameter::LOADING_WITHOUT_MOJO, |
| + TestParameter::LOADING_WITH_MOJO)); |
| + |
| } // namespace content |