Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / serviceworker / resources / fetch-event-after-navigation-within-page-iframe.html
blobbf8a6d5ce51facdd65f30ce5750417c7fcf2ef02
1 <!DOCTYPE html>
2 <script>
3 function fetch_url(url) {
4 return new Promise(function(resolve, reject) {
5 var request = new XMLHttpRequest();
6 request.addEventListener('load', function(event) {
7 if (request.status == 200)
8 resolve(request.response);
9 else
10 reject(new Error('fetch_url: ' + request.statusText + " : " + url));
11 });
12 request.addEventListener('error', function(event) {
13 reject(new Error('fetch_url encountered an error: ' + url));
14 });
15 request.addEventListener('abort', function(event) {
16 reject(new Error('fetch_url was aborted: ' + url));
17 });
18 request.open('GET', url);
19 request.send();
20 });
22 </script>