Commit 0d64a4bc authored by Andrey Kosyakov's avatar Andrey Kosyakov Committed by Commit Bot

DevTools: fix TestRawHeadersWithRedirectAndHSTS with network service enabled

Bug: 721408
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: I2470b02838678052524ab146fe3438a885e7799e
Reviewed-on: https://chromium-review.googlesource.com/994540Reviewed-by: default avatarDmitry Gozman <dgozman@chromium.org>
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547973}
parent 5d8129e5
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
#include "content/public/browser/render_view_host.h" #include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host.h" #include "content/public/browser/render_widget_host.h"
#include "content/public/browser/render_widget_host_view.h" #include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/browser/url_data_source.h" #include "content/public/browser/url_data_source.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui_controller.h" #include "content/public/browser/web_ui_controller.h"
...@@ -86,6 +87,7 @@ ...@@ -86,6 +87,7 @@
#include "net/url_request/url_request_context_getter.h" #include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_filter.h" #include "net/url_request/url_request_filter.h"
#include "net/url_request/url_request_http_job.h" #include "net/url_request/url_request_http_job.h"
#include "services/network/public/cpp/features.h"
#include "third_party/WebKit/public/platform/WebInputEvent.h" #include "third_party/WebKit/public/platform/WebInputEvent.h"
#include "ui/compositor/compositor_switches.h" #include "ui/compositor/compositor_switches.h"
#include "ui/gl/gl_switches.h" #include "ui/gl/gl_switches.h"
...@@ -2085,12 +2087,23 @@ IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestRawHeadersWithRedirectAndHSTS) { ...@@ -2085,12 +2087,23 @@ IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestRawHeadersWithRedirectAndHSTS) {
https_test_server.ServeFilesFromSourceDirectory("chrome/test/data"); https_test_server.ServeFilesFromSourceDirectory("chrome/test/data");
ASSERT_TRUE(https_test_server.Start()); ASSERT_TRUE(https_test_server.Start());
GURL https_url = https_test_server.GetURL("localhost", "/devtools/image.png"); GURL https_url = https_test_server.GetURL("localhost", "/devtools/image.png");
BrowserThread::PostTask( if (!base::FeatureList::IsEnabled(network::features::kNetworkService)) {
BrowserThread::IO, FROM_HERE, BrowserThread::PostTask(
base::BindOnce( BrowserThread::IO, FROM_HERE,
AddHSTSHost, base::BindOnce(
base::RetainedRef(browser()->profile()->GetRequestContext()), AddHSTSHost,
https_url.host())); base::RetainedRef(browser()->profile()->GetRequestContext()),
https_url.host()));
} else {
base::Time expiry = base::Time::Now() + base::TimeDelta::FromDays(1000);
bool include_subdomains = false;
mojo::ScopedAllowSyncCallForTesting allow_sync_call;
content::StoragePartition* partition =
content::BrowserContext::GetDefaultStoragePartition(
browser()->profile());
partition->GetNetworkContext()->AddHSTSForTesting(https_url.host(), expiry,
include_subdomains);
}
ASSERT_TRUE(embedded_test_server()->Start()); ASSERT_TRUE(embedded_test_server()->Start());
OpenDevToolsWindow(std::string(), false); OpenDevToolsWindow(std::string(), false);
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
-BackgroundXhrTest.HttpAuth -BackgroundXhrTest.HttpAuth
-BackgroundXhrTest.TlsClientAuth -BackgroundXhrTest.TlsClientAuth
-ChromeSecurityExploitBrowserTest.CreateFilesystemURLInExtensionOrigin -ChromeSecurityExploitBrowserTest.CreateFilesystemURLInExtensionOrigin
-DevToolsSanityTest.TestRawHeadersWithRedirectAndHSTS
-DisabledSignInIsolationBrowserTest.SyntheticTrial -DisabledSignInIsolationBrowserTest.SyntheticTrial
-DomainReliabilityBrowserTest.Upload -DomainReliabilityBrowserTest.Upload
-EnabledSignInIsolationBrowserTest.SyntheticTrial -EnabledSignInIsolationBrowserTest.SyntheticTrial
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment