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

Side by Side Diff: LayoutTests/http/tests/permissions/resources/helpers.js

Issue 760223003: Stub implementation of Permissions API module. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: forgot a nit Created 6 years 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
(Empty)
1 // This file is using testharness.js coding style.
2
3 function get_script_href()
4 {
5 var filename = window.location.href.substr(window.location.href.lastIndexOf( '/') + 1);
6 return 'resources/' + filename.replace('.html', '.js');
7 }
8
9 function get_current_scope()
10 {
11 if ('document' in self) {
12 return 'Window';
13 }
14 if ('DedicatedWorkerGlobalScope' in self &&
15 self instanceof DedicatedWorkerGlobalScope) {
16 return 'DedicatedWorker';
17 }
18 if ('SharedWorkerGlobalScope' in self &&
19 self instanceof SharedWorkerGlobalScope) {
20 return 'SharedWorker';
21 }
22 if ('ServiceWorkerGlobalScope' in self &&
23 self instanceof ServiceWorkerGlobalScope) {
24 return 'ServiceWorker';
25 }
26
27 throw new Error('unknown scope');
28 }
29
30 function runTest() {
31 var script_href = get_script_href();
32
33 // Run the tests on the Window scope.
34 var script_element = document.createElement('script');
35 script_element.src = script_href;
36 document.body.appendChild(script_element);
37
38 // Run the tests on {Dedicated,Shared,Shared}Worker.
Peter Beverloo 2014/12/01 13:26:07 nit: s/Shared\}/Service\}/
mlamouri (slow - plz ping) 2014/12/01 13:33:17 Done.
39 fetch_tests_from_worker(new Worker(script_href));
40 fetch_tests_from_worker(new SharedWorker(script_href));
41 window.service_worker_test(script_href);
42 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698