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

Unified Diff: third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/resources/worker-interception-iframe.https.html

Issue 2415873002: Import w3c tests for the service workers (Closed)
Patch Set: Rebase Created 4 years, 2 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/imported/wpt/service-workers/service-worker/resources/worker-interception-iframe.https.html
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/resources/worker-interception-iframe.https.html b/third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/resources/worker-interception-iframe.https.html
new file mode 100644
index 0000000000000000000000000000000000000000..12a461ea5db208998eaab447db88fc36428fa45d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/resources/worker-interception-iframe.https.html
@@ -0,0 +1,39 @@
+<script src="../resources/get-host-info.sub.js"></script>
+<script src="test-helpers.sub.js?pipe=sub"></script>
+<script>
+var host_info = get_host_info();
+
+function boilerplate_test(msg) {
+ return new Promise(function(resolve, reject) {
+ var worker = new Worker("load_worker.js");
+ worker.onmessage = function(e) { resolve(e.data) };
+ worker.onerror = function(e) { reject(e) };
+ worker.postMessage(msg);
+ })
+ .then(function(data) {
+ window.parent.postMessage({results: data}, host_info['HTTPS_ORIGIN']);
+ });
+}
+
+function xhr_test() {
+ return boilerplate_test("xhr");
+}
+
+function fetch_test() {
+ return boilerplate_test("fetch");
+}
+
+function importScripts_test() {
+ return boilerplate_test("importScripts");
+}
+
+window.addEventListener('message', function(evt) {
+ var port = evt.ports[0];
+ xhr_test()
+ .then(fetch_test)
+ .then(importScripts_test)
+ .then(function() { port.postMessage({results: 'finish'}); })
+ .catch(function(e) { port.postMessage({results: 'failure:' + e}); });
+ });
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698