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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/iso-latin1-header-iframe.html

Issue 1403773004: [Service Workers] Follow-up CL for DCHECK from WebServiceWorkerResponse. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/serviceworker/iso-latin1-header.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <script src="../../resources/testharness.js"></script> 1 <script src="../../resources/testharness.js"></script>
2 <script src="test-helpers.js?pipe=sub"></script> 2 <script src="test-helpers.js?pipe=sub"></script>
3 <script> 3 <script>
4 4
5 function xhr_send(method, data) { 5 function xhr_send(method, data) {
6 return new Promise(function(resolve, reject) { 6 return new Promise(function(resolve, reject) {
7 var xhr = new XMLHttpRequest(); 7 var xhr = new XMLHttpRequest();
8 xhr.onload = function() { 8 xhr.onload = function() {
9 resolve(); 9 resolve();
10 }; 10 };
11 xhr.onerror = function() { 11 xhr.onerror = function() {
12 reject('XHR must fail.'); 12 reject('XHR must succeed.');
13 }; 13 };
14 xhr.responseType = 'text'; 14 xhr.responseType = 'text';
15 xhr.open(method, './dummy?test', true); 15 xhr.open(method, './dummy?test', true);
16 xhr.send(data); 16 xhr.send(data);
17 }); 17 });
18 } 18 }
19 19
20
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 });
26
27 </script> 27 </script>
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/serviceworker/iso-latin1-header.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698