Commit 6af9df3e authored by Tarun Bansal's avatar Tarun Bansal Committed by Commit Bot

Enable ClientHintsPersistent feature (Accept-CH-Lifetime header).

blink-dev i2s thread: https://groups.google.com/a/chromium.org/d/topic/blink-dev/8RBFue7RMXQ/discussion

Change-Id: I5595b3aed72ea0cece88948f69f480f5808fce6b
Bug: 735518,782381,816661
TBR: raymes@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/957265Reviewed-by: default avatarTarun Bansal <tbansal@chromium.org>
Reviewed-by: default avatarDavid Dorwin <ddorwin@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Tarun Bansal <tbansal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543786}
parent a6de7e84
......@@ -633,6 +633,10 @@ IN_PROC_BROWSER_TEST_F(ClientHintsBrowserTest,
->GetSettingsForOneType(CONTENT_SETTINGS_TYPE_CLIENT_HINTS, std::string(),
&host_settings);
EXPECT_EQ(1u, host_settings.size());
// Clear settings.
HostContentSettingsMapFactory::GetForProfile(browser()->profile())
->ClearSettingsForOneType(CONTENT_SETTINGS_TYPE_JAVASCRIPT);
}
// Ensure that when the JavaScript is blocked, persisted client hints are not
......@@ -753,6 +757,10 @@ IN_PROC_BROWSER_TEST_F(ClientHintsBrowserTest,
EXPECT_EQ(2u, count_client_hints_headers_seen());
EXPECT_EQ(3u, third_party_request_count_seen());
EXPECT_EQ(0u, third_party_client_hints_count_seen());
// Clear settings.
HostContentSettingsMapFactory::GetForProfile(browser()->profile())
->ClearSettingsForOneType(CONTENT_SETTINGS_TYPE_JAVASCRIPT);
}
// Ensure that when the cookies is blocked, client hints are not attached to the
......@@ -809,6 +817,10 @@ IN_PROC_BROWSER_TEST_F(ClientHintsBrowserTest,
EXPECT_EQ(2u, count_client_hints_headers_seen());
EXPECT_EQ(3u, third_party_request_count_seen());
EXPECT_EQ(0u, third_party_client_hints_count_seen());
// Clear settings.
HostContentSettingsMapFactory::GetForProfile(browser()->profile())
->ClearSettingsForOneType(CONTENT_SETTINGS_TYPE_COOKIES);
}
// Check the client hints for the given URL in an incognito window.
......
......@@ -473,6 +473,19 @@ class PepperContentSettingsSpecialCasesJavaScriptBlockedTest
content_settings_map->SetDefaultContentSetting(
CONTENT_SETTINGS_TYPE_JAVASCRIPT, CONTENT_SETTING_BLOCK);
}
void SetUpCommandLine(base::CommandLine* command_line) override {
PepperContentSettingsSpecialCasesTest::SetUpCommandLine(command_line);
// ClientHintsPersistent feature queries the status of JavaScript content
// setting on every page load. When JavaScript is blocked, this results in
// tab_settings->IsContentBlocked(CONTENT_SETTINGS_TYPE_JAVASCRIPT) always
// returning true in RunJavaScriptBlockedTest() method. This interferes with
// the execution of the test.
// TODO: https://crbug.com/822553: Make these tests compatible with the
// client hints feature.
command_line->AppendSwitchASCII("disable-blink-features",
"ClientHintsPersistent");
}
};
// A sanity check to verify that the plugin that is used as a baseline below
......
......@@ -188,7 +188,7 @@
},
{
name: "ClientHintsPersistent",
status: "experimental",
status: "stable",
},
{
name: "ClientPlaceholdersForServerLoFi",
......
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