| Index: third_party/WebKit/LayoutTests/http/tests/serviceworker/register-link-element.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/register-link-element.html b/third_party/WebKit/LayoutTests/http/tests/serviceworker/register-link-element.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..0792ded0830a6b8daaf333861342a5d4b643c726
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/register-link-element.html
|
| @@ -0,0 +1,26 @@
|
| +<!DOCTYPE html>
|
| +<script src="../resources/testharness.js"></script>
|
| +<script src="../resources/testharness-helpers.js"></script>
|
| +<script src="../resources/testharnessreport.js"></script>
|
| +<script src="resources/test-helpers.js"></script>
|
| +<script src="resources/registration-tests.js"></script>
|
| +<body>
|
| +<script>
|
| +
|
| +function registerUsingLink(script, options) {
|
| + var scope = options.scope;
|
| + var link = document.createElement('link');
|
| + link.setAttribute('rel', 'serviceworker');
|
| + link.setAttribute('href', script);
|
| + link.setAttribute('scope', scope);
|
| + document.getElementsByTagName('head')[0].appendChild(link);
|
| + return new Promise(function(resolve, reject) {
|
| + link.onload = resolve;
|
| + link.onerror = reject;
|
| + })
|
| + .then(() => navigator.serviceWorker.getRegistration(scope));
|
| +}
|
| +
|
| +registration_tests(registerUsingLink, false);
|
| +
|
| +</script>
|
|
|