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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/clear-site-data/navigation.https.html

Issue 2913553004: Add the 'cache' datatype to the clear-site-data WPT (Closed)
Patch Set: Rebase, syntax, cache busting. Created 3 years, 5 months 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
Index: third_party/WebKit/LayoutTests/external/wpt/clear-site-data/navigation.https.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/clear-site-data/navigation.html b/third_party/WebKit/LayoutTests/external/wpt/clear-site-data/navigation.https.html
similarity index 55%
rename from third_party/WebKit/LayoutTests/external/wpt/clear-site-data/navigation.html
rename to third_party/WebKit/LayoutTests/external/wpt/clear-site-data/navigation.https.html
index cd0f83e17f02567522624968d1ac62f029d126eb..761ebddcdcdd4c9851c023d714e45d006490cf6e 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/clear-site-data/navigation.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/clear-site-data/navigation.https.html
@@ -11,11 +11,17 @@
/** Ensures that all datatypes are nonempty. */
function populateDatatypes() {
return Promise.all(TestUtils.DATATYPES.map(function(datatype) {
- return datatype.add().then(datatype.isEmpty().then(function(isEmpty) {
- assert_false(
- isEmpty,
- datatype.name + " has to be nonempty before the test starts.");
- }));
+ return new Promise(function(resolve, reject) {
+ datatype.add().then(function() {
+ datatype.isEmpty().then(function(isEmpty) {
+ assert_false(
+ isEmpty,
+ datatype.name +
+ " has to be nonempty before the test starts.");
+ resolve();
+ });
+ });
+ });
}));
}
@@ -37,7 +43,7 @@
report[datatype.name],
datatype.name + " should NOT have been cleared.");
}
- })
+ });
}
TestUtils.COMBINATIONS.forEach(function(combination) {
@@ -46,19 +52,24 @@
combination.map(function(e) { return e.name; }).join(", ");
promise_test(function(test) {
- return populateDatatypes()
- .then(function() {
- // Navigate to a resource with a Clear-Site-Data header in an
- // iframe, then verify that the correct types have been deleted.
- return new Promise(function(resolve, reject) {
- window.addEventListener("message", resolve);
- var iframe = document.createElement("iframe");
- iframe.src = TestUtils.getClearSiteDataUrl(combination);
- document.body.appendChild(iframe);
- }).then(function(messageEvent) {
- verifyDatatypes(combination, messageEvent.data);
+ TestUtils.bustCache();
+ return new Promise(function(resolve_test, reject_test) {
+ populateDatatypes()
+ .then(function() {
+ // Navigate to a resource with a Clear-Site-Data header in
+ // an iframe, then verify that the correct types have been
+ // deleted.
+ return new Promise(function(resolve, reject) {
+ window.addEventListener("message", resolve);
+ var iframe = document.createElement("iframe");
+ iframe.src = TestUtils.getClearSiteDataUrl(combination);
+ document.body.appendChild(iframe);
+ }).then(function(messageEvent) {
+ verifyDatatypes(combination, messageEvent.data);
+ resolve_test();
+ });
});
- });
+ });
}, test_name);
});
</script>

Powered by Google App Engine
This is Rietveld 408576698