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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/resources/invalid-header-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 unified diff | Download patch
OLDNEW
1 <script src="../../resources/testharness.js"></script> 1 <script src="test-helpers.sub.js?pipe=sub"></script>
2 <script src="test-helpers.js"></script>
3 <script> 2 <script>
4 3
5 function xhr_send(method, data) { 4 function xhr_send(method, data) {
6 return new Promise(function(resolve, reject) { 5 return new Promise(function(resolve, reject) {
7 var xhr = new XMLHttpRequest(); 6 var xhr = new XMLHttpRequest();
8 xhr.onload = function() { 7 xhr.onload = function() {
9 reject('XHR must fail.'); 8 reject('XHR must fail.');
10 }; 9 };
11 xhr.onerror = function() { 10 xhr.onerror = function() {
12 resolve(); 11 resolve();
13 }; 12 };
14 xhr.responseType = 'text'; 13 xhr.responseType = 'text';
15 xhr.open(method, './dummy?test', true); 14 xhr.open(method, './dummy?test', true);
16 xhr.send(data); 15 xhr.send(data);
17 }); 16 });
18 } 17 }
19 18
20 19
21 window.addEventListener('message', function(evt) { 20 window.addEventListener('message', function(evt) {
22 var port = evt.ports[0]; 21 var port = evt.ports[0];
23 xhr_send('POST', 'test string') 22 xhr_send('POST', 'test string')
24 .then(function() { port.postMessage({results: 'finish'}); }) 23 .then(function() { port.postMessage({results: 'finish'}); })
25 .catch(function(e) { port.postMessage({results: 'failure:' + e}); }); 24 .catch(function(e) { port.postMessage({results: 'failure:' + e}); });
26 }); 25 });
27 </script> 26 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698