Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / serviceworker / uncontrolled-page.html
blob5da0e9701369ee2b892b1272e1f48d4c16c71d56
1 <!DOCTYPE html>
2 <title>Service Worker: Registration</title>
3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script>
5 <script src="resources/test-helpers.js"></script>
6 <script>
7 function fetch_url(url) {
8 return new Promise(function(resolve, reject) {
9 var request = new XMLHttpRequest();
10 request.addEventListener('load', function(event) {
11 if (request.status == 200)
12 resolve(request.response);
13 else
14 reject(Error(request.statusText));
15 });
16 request.open('GET', url);
17 request.send();
18 });
20 var worker = 'resources/fail-on-fetch-worker.js';
22 async_test(function(t) {
23 var scope = 'resources/scope/uncontrolled-page/';
24 service_worker_unregister_and_register(t, worker, scope)
25 .then(function(reg) {
26 return wait_for_state(t, reg.installing, 'activated');
28 .then(function() {
29 return fetch_url('/serviceworker/resources/simple.txt');
31 .then(function(text) {
32 assert_equals(text, 'a simple text file\n');
33 service_worker_unregister_and_done(t, scope);
35 .catch(t.step_func(function(reason) {
36 assert_unreached(reason.message);
37 }));
38 }, 'Fetch events should not go through uncontrolled page.');
39 </script>