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

Unified Diff: content/browser/cross_site_transfer_browsertest.cc

Issue 2496193002: Implement transfer navigation with mojo (Closed)
Patch Set: fix Created 4 years, 1 month 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
« no previous file with comments | « no previous file | content/browser/loader/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6711ca5ad0d2f813e40ee93184a3ce6723199ff0..aca2513f62325183df8d44ae27fa3baa4d8dbf27 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,
+ "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,9 @@ 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
« no previous file with comments | « no previous file | content/browser/loader/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698