Commit d0976380 authored by Martin Sramek's avatar Martin Sramek Committed by Commit Bot

Reenable the "cache" datatype in Clear-Site-Data

Testing under heavy load (on the order of thousands of resource loads
writing into the cache and clearing it) did not produce crashes or other
adverse effects.

Therefore, we reenable the cache datatype for M65. With plenty of time
to test on unstable channels of Chromium, and to perform additional
heavy load tests, we should be able to re-ship with confidence in M65.

Bug: 762417
Change-Id: I17bc1efb38fb9d3f5b7e91de2048420dbe75f6ac
Reviewed-on: https://chromium-review.googlesource.com/809128Reviewed-by: default avatarMike West <mkwst@chromium.org>
Commit-Queue: Martin Šrámek <msramek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#522414}
parent 24138678
......@@ -473,10 +473,7 @@ bool ClearSiteDataThrottle::ParseHeader(const std::string& header,
} else if (input_types[i] == kDatatypeStorage) {
data_type = clear_storage;
} else if (input_types[i] == kDatatypeCache) {
delegate->AddMessage(
current_url, "The \"cache\" datatype is temporarily not supported.",
CONSOLE_MESSAGE_LEVEL_ERROR);
continue;
data_type = clear_cache;
} else {
delegate->AddMessage(
current_url,
......
......@@ -760,15 +760,11 @@ IN_PROC_BROWSER_TEST_F(ClearSiteDataThrottleBrowserTest, Types) {
} test_cases[] = {
{"\"cookies\"", true, false, false},
{"\"storage\"", false, true, false},
// TODO(crbug.com/762417): The "cache" parameter is temporarily disabled.
{"\"cache\"", false, false, false},
{"\"cache\"", false, false, true},
{"\"cookies\", \"storage\"", true, true, false},
// TODO(crbug.com/762417): The "cache" parameter is temporarily disabled.
{"\"cookies\", \"cache\"", true, false, false},
{"\"storage\", \"cache\"", false, true, false},
{"\"cookies\", \"storage\", \"cache\"", true, true, false},
{"\"cookies\", \"cache\"", true, false, true},
{"\"storage\", \"cache\"", false, true, true},
{"\"cookies\", \"storage\", \"cache\"", true, true, true},
};
for (const TestCase& test_case : test_cases) {
......@@ -855,9 +851,7 @@ IN_PROC_BROWSER_TEST_F(ClearSiteDataThrottleBrowserTest,
// entries are actually written to the disk. Other tests using CacheTestUtil
// show that a timeout of around 1s between cache operations is necessary to
// avoid flakiness.
// TODO(crbug.com/762417): The "cache" parameter is temporarily disabled.
IN_PROC_BROWSER_TEST_F(ClearSiteDataThrottleBrowserTest,
DISABLED_CacheIntegrationTest) {
IN_PROC_BROWSER_TEST_F(ClearSiteDataThrottleBrowserTest, CacheIntegrationTest) {
const int kTimeoutMs = 1000;
CacheTestUtil util(
......
......@@ -179,24 +179,17 @@ TEST_F(ClearSiteDataThrottleTest, ParseHeaderAndExecuteClearingTask) {
// One data type.
{"\"cookies\"", true, false, false},
{"\"storage\"", false, true, false},
// TODO(crbug.com/762417): The "cache" parameter is temporarily disabled.
// Therefore, a header consisting solely of the "cache" parameter is
// invalid. As this test verifies the behavior of Clear-Site-Data with
// valid headers, we will omit such test case.
{"\"cache\"", false, false, true},
// Two data types.
{"\"cookies\", \"storage\"", true, true, false},
// TODO(crbug.com/762417): The "cache" parameter is temporarily disabled.
{"\"cookies\", \"cache\"", true, false, false},
{"\"storage\", \"cache\"", false, true, false},
{"\"cookies\", \"cache\"", true, false, true},
{"\"storage\", \"cache\"", false, true, true},
// Three data types.
// TODO(crbug.com/762417): The "cache" parameter is temporarily disabled.
{"\"storage\", \"cache\", \"cookies\"", true, true, false},
{"\"cache\", \"cookies\", \"storage\"", true, true, false},
{"\"cookies\", \"storage\", \"cache\"", true, true, false},
{"\"storage\", \"cache\", \"cookies\"", true, true, true},
{"\"cache\", \"cookies\", \"storage\"", true, true, true},
{"\"cookies\", \"storage\", \"cache\"", true, true, true},
// The wildcard datatype is not yet shipped.
{"\"*\", \"storage\"", false, true, false},
......@@ -214,16 +207,15 @@ TEST_F(ClearSiteDataThrottleTest, ParseHeaderAndExecuteClearingTask) {
// Unknown types are ignored, but we still proceed with the deletion for
// those that we recognize.
{"\"storage\", \"foo\"", false, true, false},
{"\"cache\", \"foo\"", false, false, true},
};
std::vector<TestCase> experimental_test_cases = {
// Wildcard.
// TODO(crbug.com/762417): The "cache" parameter is temporarily disabled.
{"\"*\"", true, true, false},
{"\"*\", \"storage\"", true, true, false},
{"\"cache\", \"*\", \"storage\"", true, true, false},
{"\"*\", \"cookies\", \"*\"", true, true, false},
{"\"*\"", true, true, true},
{"\"*\", \"storage\"", true, true, true},
{"\"cache\", \"*\", \"storage\"", true, true, true},
{"\"*\", \"cookies\", \"*\"", true, true, true},
};
const std::vector<TestCase>* test_case_sets[] = {&standard_test_cases,
......@@ -290,9 +282,6 @@ TEST_F(ClearSiteDataThrottleTest, InvalidHeader) {
{"\"passwords\"",
"Unrecognized type: \"passwords\".\n"
"No recognized types specified.\n"},
{"\"cache\"",
"The \"cache\" datatype is temporarily not supported.\n"
"No recognized types specified.\n"},
// The wildcard datatype is not yet shipped.
{"[ \"*\" ]",
"Unrecognized type: [ \"*\" ].\n"
......@@ -589,9 +578,9 @@ TEST_F(ClearSiteDataThrottleTest, FormattedConsoleOutput) {
"No recognized types specified.\n"},
// Successful deletion on the same URL.
{"\"cookies\"", "https://origin3.com/bar",
{"\"cache\"", "https://origin3.com/bar",
"Clear-Site-Data header on 'https://origin3.com/bar': "
"Cleared data types: \"cookies\".\n"},
"Cleared data types: \"cache\".\n"},
// Redirect to the original URL.
// Successful deletion outputs one line.
......
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