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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/invalid-blobtype-iframe.html

Issue 2865313003: Upstream service worker tests to WPT (Closed)
Patch Set: Re-introduce resource script Created 3 years, 7 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 unified diff | Download patch
OLDNEW
(Empty)
1 <script src="../../resources/testharness.js"></script>
2 <script src="test-helpers.js"></script>
3 <script>
4
5 function xhr_send(method, data) {
6 return new Promise(function(resolve, reject) {
7 var xhr = new XMLHttpRequest();
8 xhr.onload = function() {
9 if (xhr.getResponseHeader('Content-Type') !== null) {
10 reject('Content-Type must be null.');
11 }
12 resolve();
13 };
14 xhr.onerror = function() {
15 reject('XHR must succeed.');
16 };
17 xhr.responseType = 'text';
18 xhr.open(method, './dummy?test', true);
19 xhr.send(data);
20 });
21 }
22
23
24 window.addEventListener('message', function(evt) {
25 var port = evt.ports[0];
26 xhr_send('POST', 'test string')
27 .then(function() { port.postMessage({results: 'finish'}); })
28 .catch(function(e) { port.postMessage({results: 'failure:' + e}); });
29 });
30 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698