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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/clear-site-data/support/test_utils.js

Issue 2965173003: Test that Clear-Site-Data is not supported on an insecure navigation (Closed)
Patch Set: Extract populateDatatypes() to TestUtils 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
« no previous file with comments | « third_party/WebKit/LayoutTests/external/wpt/clear-site-data/navigation.https.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/external/wpt/clear-site-data/support/test_utils.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/clear-site-data/support/test_utils.js b/third_party/WebKit/LayoutTests/external/wpt/clear-site-data/support/test_utils.js
index 6aff373f23a46d1887689618104c86c144cef108..35b0a01e5ecabd8ef7fe36e76576c6f514af909a 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/clear-site-data/support/test_utils.js
+++ b/third_party/WebKit/LayoutTests/external/wpt/clear-site-data/support/test_utils.js
@@ -74,6 +74,26 @@ var TestUtils = (function() {
return combinations;
})();
+ /**
+ * Ensures that all datatypes are nonempty. Should be called in the test
+ * setup phase.
+ */
+ TestUtils.populateDatatypes = function() {
+ return Promise.all(TestUtils.DATATYPES.map(function(datatype) {
+ 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();
+ });
+ });
+ });
+ }));
+ };
+
/**
* Get the support server URL that returns a Clear-Site-Data header
* to clear |datatypes|.
« no previous file with comments | « third_party/WebKit/LayoutTests/external/wpt/clear-site-data/navigation.https.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698