Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / serviceworker / chromium / register-different-script-many-times.html
blob35fe076fdf074bdc011ccce53b30c87f9f0510f3
1 <!DOCTYPE html>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <script src="../resources/test-helpers.js"></script>
5 <script>
6 var script1 = normalizeURL('../resources/empty-worker.js');
7 var script2 = normalizeURL('../resources/empty-worker.js?new');
9 promise_test(function(t) {
10 var scope = '../resources/scope/register-30-times';
12 return service_worker_unregister(t, scope)
13 .then(function() {
14 var promises = [];
15 for (var i = 0; i < 15; ++i) {
16 promises.push(navigator.serviceWorker.register(script1,
17 { scope: scope }));
18 promises.push(navigator.serviceWorker.register(script2,
19 { scope: scope }));
21 return Promise.all(promises);
23 .then(function(registrations) {
24 return registrations[0].unregister();
25 });
26 }, 'Repetitive registrations with the same scope should not trigger OOM');
28 </script>