Skip to content

Service worker: test valid mime types#5376

Merged
annevk merged 2 commits intoweb-platform-tests:masterfrom
jakearchibald:sw-mimetypes
Apr 7, 2017
Merged

Service worker: test valid mime types#5376
annevk merged 2 commits intoweb-platform-tests:masterfrom
jakearchibald:sw-mimetypes

Conversation

@jakearchibald
Copy link
Copy Markdown
Contributor

@jakearchibald jakearchibald commented Apr 5, 2017

This change is Reviewable

@wpt-pr-bot
Copy link
Copy Markdown
Collaborator

Notifying @ehsan, @mattto, and @mkruisselbrink. (Learn how reviewing works.)

@jakearchibald
Copy link
Copy Markdown
Contributor Author

@domenic these appear to pass/fail correctly in Chrome according to previously spec'd behaviour.

Copy link
Copy Markdown
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM although ideally someone who knew more about reviewing service worker tests and registrations and unregistering and so on would chime in.

@annevk
Copy link
Copy Markdown
Member

annevk commented Apr 5, 2017

What about importScripts()? Or does service workers not impose additional requirements there?

@domenic
Copy link
Copy Markdown
Member

domenic commented Apr 5, 2017

Good point, the spec change changes both I think, so the tests need to test both ideally.

@annevk
Copy link
Copy Markdown
Member

annevk commented Apr 5, 2017

Since you install them on the same scope, and they run in parallel, is the way registration works that it waits until that completes (and unregisters) before starting a new one?

@jakearchibald
Copy link
Copy Markdown
Contributor Author

promise_test doesn't run in parallel.

Good point about importScripts. Will write tests now.

@domenic
Copy link
Copy Markdown
Member

domenic commented Apr 5, 2017

promise_tests run sequentially, thankfully. async_tests run in parallel.

@ghost
Copy link
Copy Markdown

ghost commented Apr 5, 2017

View the complete job log.

Firefox (nightly channel)

Testing web-platform-tests at revision a35d820
Using browser at version BuildID 20170404100210; SourceStamp b5d8b27a753725c1de41ffae2e338798f3b5cacd
Starting 10 test iterations
All results were stable

All results

2 tests ran
/service-workers/service-worker/register-link-element.https.html
Subtest Results Messages
TIMEOUT
Registering normal scope TIMEOUT Test timed out
Registering scope with fragment NOTRUN
Registering same scope as the script directory NOTRUN
Registering same scope as the script directory without the last slash NOTRUN
Registration scope outside the script directory NOTRUN
Registering scope outside domain NOTRUN
Registering script outside domain NOTRUN
Registering non-existent script NOTRUN
Registering invalid chunked encoding script NOTRUN
Registering invalid chunked encoding script with flush NOTRUN
Registering script with no MIME type NOTRUN
Registering script with bad MIME type NOTRUN
Registering script with good MIME type application/ecmascript NOTRUN
Registering script that imports script with good MIME type application/ecmascript NOTRUN
Registering script with good MIME type application/javascript NOTRUN
Registering script that imports script with good MIME type application/javascript NOTRUN
Registering script with good MIME type application/x-ecmascript NOTRUN
Registering script that imports script with good MIME type application/x-ecmascript NOTRUN
Registering script with good MIME type application/x-javascript NOTRUN
Registering script that imports script with good MIME type application/x-javascript NOTRUN
Registering script with good MIME type text/ecmascript NOTRUN
Registering script that imports script with good MIME type text/ecmascript NOTRUN
Registering script with good MIME type text/javascript NOTRUN
Registering script that imports script with good MIME type text/javascript NOTRUN
Registering script with good MIME type text/javascript1.0 NOTRUN
Registering script that imports script with good MIME type text/javascript1.0 NOTRUN
Registering script with good MIME type text/javascript1.1 NOTRUN
Registering script that imports script with good MIME type text/javascript1.1 NOTRUN
Registering script with good MIME type text/javascript1.2 NOTRUN
Registering script that imports script with good MIME type text/javascript1.2 NOTRUN
Registering script with good MIME type text/javascript1.3 NOTRUN
Registering script that imports script with good MIME type text/javascript1.3 NOTRUN
Registering script with good MIME type text/javascript1.4 NOTRUN
Registering script that imports script with good MIME type text/javascript1.4 NOTRUN
Registering script with good MIME type text/javascript1.5 NOTRUN
Registering script that imports script with good MIME type text/javascript1.5 NOTRUN
Registering script with good MIME type text/jscript NOTRUN
Registering script that imports script with good MIME type text/jscript NOTRUN
Registering script with good MIME type text/livescript NOTRUN
Registering script that imports script with good MIME type text/livescript NOTRUN
Registering script with good MIME type text/x-ecmascript NOTRUN
Registering script that imports script with good MIME type text/x-ecmascript NOTRUN
Registering script with good MIME type text/x-javascript NOTRUN
Registering script that imports script with good MIME type text/x-javascript NOTRUN
Registering script that imports script with no MIME type NOTRUN
Registering script that imports script with bad MIME type NOTRUN
Registering redirected script NOTRUN
Registering script including parse error NOTRUN
Registering script including undefined error NOTRUN
Registering script including uncaught exception NOTRUN
Registering script including caught exception NOTRUN
Registering script importing malformed script NOTRUN
Registering script importing non-existent script NOTRUN
Scope including URL-encoded multibyte characters NOTRUN
Scope including non-escaped multibyte characters NOTRUN
Script URL including URL-encoded slash NOTRUN
Script URL including uppercase URL-encoded slash NOTRUN
Scope including URL-encoded slash NOTRUN
Script URL including URL-encoded backslash NOTRUN
Script URL including uppercase URL-encoded backslash NOTRUN
Scope including URL-encoded backslash NOTRUN
Script URL including self-reference NOTRUN
Scope including self-reference NOTRUN
Script URL including parent-reference NOTRUN
Scope including parent-reference NOTRUN
Scope including parent-reference and not under the script directory NOTRUN
Script URL including consecutive slashes NOTRUN
Scope including consecutive slashes NOTRUN
Script URL is same-origin filesystem: URL NOTRUN
Scope URL is same-origin filesystem: URL NOTRUN
/service-workers/service-worker/registration.https.html
Subtest Results Messages
OK
Registering normal scope PASS
Registering scope with fragment PASS
Registering same scope as the script directory PASS
Registering same scope as the script directory without the last slash PASS
Registration scope outside the script directory PASS
Registering scope outside domain PASS
Registering script outside domain PASS
Registering non-existent script PASS
Registering invalid chunked encoding script PASS
Registering invalid chunked encoding script with flush PASS
Registering script with no MIME type PASS
Registering script with bad MIME type PASS
Registering script with good MIME type application/ecmascript FAIL promise_test: Unhandled rejection with value: object "SecurityError: The operation is insecure."
Registering script that imports script with good MIME type application/ecmascript PASS
Registering script with good MIME type application/javascript PASS
Registering script that imports script with good MIME type application/javascript PASS
Registering script with good MIME type application/x-ecmascript FAIL promise_test: Unhandled rejection with value: object "SecurityError: The operation is insecure."
Registering script that imports script with good MIME type application/x-ecmascript PASS
Registering script with good MIME type application/x-javascript PASS
Registering script that imports script with good MIME type application/x-javascript PASS
Registering script with good MIME type text/ecmascript FAIL promise_test: Unhandled rejection with value: object "SecurityError: The operation is insecure."
Registering script that imports script with good MIME type text/ecmascript PASS
Registering script with good MIME type text/javascript PASS
Registering script that imports script with good MIME type text/javascript PASS
Registering script with good MIME type text/javascript1.0 FAIL promise_test: Unhandled rejection with value: object "SecurityError: The operation is insecure."
Registering script that imports script with good MIME type text/javascript1.0 PASS
Registering script with good MIME type text/javascript1.1 FAIL promise_test: Unhandled rejection with value: object "SecurityError: The operation is insecure."
Registering script that imports script with good MIME type text/javascript1.1 PASS
Registering script with good MIME type text/javascript1.2 FAIL promise_test: Unhandled rejection with value: object "SecurityError: The operation is insecure."
Registering script that imports script with good MIME type text/javascript1.2 PASS
Registering script with good MIME type text/javascript1.3 FAIL promise_test: Unhandled rejection with value: object "SecurityError: The operation is insecure."
Registering script that imports script with good MIME type text/javascript1.3 PASS
Registering script with good MIME type text/javascript1.4 FAIL promise_test: Unhandled rejection with value: object "SecurityError: The operation is insecure."
Registering script that imports script with good MIME type text/javascript1.4 PASS
Registering script with good MIME type text/javascript1.5 FAIL promise_test: Unhandled rejection with value: object "SecurityError: The operation is insecure."
Registering script that imports script with good MIME type text/javascript1.5 PASS
Registering script with good MIME type text/jscript FAIL promise_test: Unhandled rejection with value: object "SecurityError: The operation is insecure."
Registering script that imports script with good MIME type text/jscript PASS
Registering script with good MIME type text/livescript FAIL promise_test: Unhandled rejection with value: object "SecurityError: The operation is insecure."
Registering script that imports script with good MIME type text/livescript PASS
Registering script with good MIME type text/x-ecmascript FAIL promise_test: Unhandled rejection with value: object "SecurityError: The operation is insecure."
Registering script that imports script with good MIME type text/x-ecmascript PASS
Registering script with good MIME type text/x-javascript FAIL promise_test: Unhandled rejection with value: object "SecurityError: The operation is insecure."
Registering script that imports script with good MIME type text/x-javascript PASS
Registering script that imports script with no MIME type FAIL assert_unreached: Should have rejected: Registration of no MIME type imported script should fail. Reached unreachable code
Registering script that imports script with bad MIME type FAIL assert_unreached: Should have rejected: Registration of plain text imported script should fail. Reached unreachable code
Registering redirected script PASS
Registering script including parse error PASS
Registering script including undefined error PASS
Registering script including uncaught exception PASS
Registering script including caught exception PASS
Registering script importing malformed script PASS
Registering script importing non-existent script PASS
Scope including URL-encoded multibyte characters PASS
Scope including non-escaped multibyte characters PASS
Script URL including URL-encoded slash PASS
Script URL including uppercase URL-encoded slash PASS
Scope including URL-encoded slash PASS
Script URL including URL-encoded backslash PASS
Script URL including uppercase URL-encoded backslash PASS
Scope including URL-encoded backslash PASS
Script URL including self-reference PASS
Scope including self-reference PASS
Script URL including parent-reference PASS
Scope including parent-reference PASS
Scope including parent-reference and not under the script directory PASS
Script URL including consecutive slashes PASS
Scope including consecutive slashes PASS
Script URL is same-origin filesystem: URL PASS
Scope URL is same-origin filesystem: URL PASS

@ghost
Copy link
Copy Markdown

ghost commented Apr 5, 2017

View the complete job log.

Chrome (unstable channel)

Testing web-platform-tests at revision a35d820
Using browser at version 59.0.3053.3 dev
Starting 10 test iterations
All results were stable

All results

2 tests ran
/service-workers/service-worker/register-link-element.https.html
Subtest Results Messages
TIMEOUT
Registering normal scope TIMEOUT Test timed out
Registering scope with fragment NOTRUN
Registering same scope as the script directory NOTRUN
Registering same scope as the script directory without the last slash NOTRUN
Registration scope outside the script directory NOTRUN
Registering scope outside domain NOTRUN
Registering script outside domain NOTRUN
Registering non-existent script NOTRUN
Registering invalid chunked encoding script NOTRUN
Registering invalid chunked encoding script with flush NOTRUN
Registering script with no MIME type NOTRUN
Registering script with bad MIME type NOTRUN
Registering script with good MIME type application/ecmascript NOTRUN
Registering script that imports script with good MIME type application/ecmascript NOTRUN
Registering script with good MIME type application/javascript NOTRUN
Registering script that imports script with good MIME type application/javascript NOTRUN
Registering script with good MIME type application/x-ecmascript NOTRUN
Registering script that imports script with good MIME type application/x-ecmascript NOTRUN
Registering script with good MIME type application/x-javascript NOTRUN
Registering script that imports script with good MIME type application/x-javascript NOTRUN
Registering script with good MIME type text/ecmascript NOTRUN
Registering script that imports script with good MIME type text/ecmascript NOTRUN
Registering script with good MIME type text/javascript NOTRUN
Registering script that imports script with good MIME type text/javascript NOTRUN
Registering script with good MIME type text/javascript1.0 NOTRUN
Registering script that imports script with good MIME type text/javascript1.0 NOTRUN
Registering script with good MIME type text/javascript1.1 NOTRUN
Registering script that imports script with good MIME type text/javascript1.1 NOTRUN
Registering script with good MIME type text/javascript1.2 NOTRUN
Registering script that imports script with good MIME type text/javascript1.2 NOTRUN
Registering script with good MIME type text/javascript1.3 NOTRUN
Registering script that imports script with good MIME type text/javascript1.3 NOTRUN
Registering script with good MIME type text/javascript1.4 NOTRUN
Registering script that imports script with good MIME type text/javascript1.4 NOTRUN
Registering script with good MIME type text/javascript1.5 NOTRUN
Registering script that imports script with good MIME type text/javascript1.5 NOTRUN
Registering script with good MIME type text/jscript NOTRUN
Registering script that imports script with good MIME type text/jscript NOTRUN
Registering script with good MIME type text/livescript NOTRUN
Registering script that imports script with good MIME type text/livescript NOTRUN
Registering script with good MIME type text/x-ecmascript NOTRUN
Registering script that imports script with good MIME type text/x-ecmascript NOTRUN
Registering script with good MIME type text/x-javascript NOTRUN
Registering script that imports script with good MIME type text/x-javascript NOTRUN
Registering script that imports script with no MIME type NOTRUN
Registering script that imports script with bad MIME type NOTRUN
Registering redirected script NOTRUN
Registering script including parse error NOTRUN
Registering script including undefined error NOTRUN
Registering script including uncaught exception NOTRUN
Registering script including caught exception NOTRUN
Registering script importing malformed script NOTRUN
Registering script importing non-existent script NOTRUN
Scope including URL-encoded multibyte characters NOTRUN
Scope including non-escaped multibyte characters NOTRUN
Script URL including URL-encoded slash NOTRUN
Script URL including uppercase URL-encoded slash NOTRUN
Scope including URL-encoded slash NOTRUN
Script URL including URL-encoded backslash NOTRUN
Script URL including uppercase URL-encoded backslash NOTRUN
Scope including URL-encoded backslash NOTRUN
Script URL including self-reference NOTRUN
Scope including self-reference NOTRUN
Script URL including parent-reference NOTRUN
Scope including parent-reference NOTRUN
Scope including parent-reference and not under the script directory NOTRUN
Script URL including consecutive slashes NOTRUN
Scope including consecutive slashes NOTRUN
Script URL is same-origin filesystem: URL NOTRUN
Scope URL is same-origin filesystem: URL NOTRUN
/service-workers/service-worker/registration.https.html
Subtest Results Messages
OK
Registering normal scope PASS
Registering scope with fragment PASS
Registering same scope as the script directory PASS
Registering same scope as the script directory without the last slash PASS
Registration scope outside the script directory PASS
Registering scope outside domain PASS
Registering script outside domain PASS
Registering non-existent script PASS
Registering invalid chunked encoding script PASS
Registering invalid chunked encoding script with flush PASS
Registering script with no MIME type PASS
Registering script with bad MIME type PASS
Registering script with good MIME type application/ecmascript FAIL promise_test: Unhandled rejection with value: object "SecurityError: Failed to register a ServiceWorker: The script has an unsupported MIME type ('application/ecmascript')."
Registering script that imports script with good MIME type application/ecmascript PASS
Registering script with good MIME type application/javascript PASS
Registering script that imports script with good MIME type application/javascript PASS
Registering script with good MIME type application/x-ecmascript FAIL promise_test: Unhandled rejection with value: object "SecurityError: Failed to register a ServiceWorker: The script has an unsupported MIME type ('application/x-ecmascript')."
Registering script that imports script with good MIME type application/x-ecmascript PASS
Registering script with good MIME type application/x-javascript PASS
Registering script that imports script with good MIME type application/x-javascript PASS
Registering script with good MIME type text/ecmascript FAIL promise_test: Unhandled rejection with value: object "SecurityError: Failed to register a ServiceWorker: The script has an unsupported MIME type ('text/ecmascript')."
Registering script that imports script with good MIME type text/ecmascript PASS
Registering script with good MIME type text/javascript PASS
Registering script that imports script with good MIME type text/javascript PASS
Registering script with good MIME type text/javascript1.0 FAIL promise_test: Unhandled rejection with value: object "SecurityError: Failed to register a ServiceWorker: The script has an unsupported MIME type ('text/javascript1.0')."
Registering script that imports script with good MIME type text/javascript1.0 PASS
Registering script with good MIME type text/javascript1.1 FAIL promise_test: Unhandled rejection with value: object "SecurityError: Failed to register a ServiceWorker: The script has an unsupported MIME type ('text/javascript1.1')."
Registering script that imports script with good MIME type text/javascript1.1 PASS
Registering script with good MIME type text/javascript1.2 FAIL promise_test: Unhandled rejection with value: object "SecurityError: Failed to register a ServiceWorker: The script has an unsupported MIME type ('text/javascript1.2')."
Registering script that imports script with good MIME type text/javascript1.2 PASS
Registering script with good MIME type text/javascript1.3 FAIL promise_test: Unhandled rejection with value: object "SecurityError: Failed to register a ServiceWorker: The script has an unsupported MIME type ('text/javascript1.3')."
Registering script that imports script with good MIME type text/javascript1.3 PASS
Registering script with good MIME type text/javascript1.4 FAIL promise_test: Unhandled rejection with value: object "SecurityError: Failed to register a ServiceWorker: The script has an unsupported MIME type ('text/javascript1.4')."
Registering script that imports script with good MIME type text/javascript1.4 PASS
Registering script with good MIME type text/javascript1.5 FAIL promise_test: Unhandled rejection with value: object "SecurityError: Failed to register a ServiceWorker: The script has an unsupported MIME type ('text/javascript1.5')."
Registering script that imports script with good MIME type text/javascript1.5 PASS
Registering script with good MIME type text/jscript FAIL promise_test: Unhandled rejection with value: object "SecurityError: Failed to register a ServiceWorker: The script has an unsupported MIME type ('text/jscript')."
Registering script that imports script with good MIME type text/jscript PASS
Registering script with good MIME type text/livescript FAIL promise_test: Unhandled rejection with value: object "SecurityError: Failed to register a ServiceWorker: The script has an unsupported MIME type ('text/livescript')."
Registering script that imports script with good MIME type text/livescript PASS
Registering script with good MIME type text/x-ecmascript FAIL promise_test: Unhandled rejection with value: object "SecurityError: Failed to register a ServiceWorker: The script has an unsupported MIME type ('text/x-ecmascript')."
Registering script that imports script with good MIME type text/x-ecmascript PASS
Registering script with good MIME type text/x-javascript FAIL promise_test: Unhandled rejection with value: object "SecurityError: Failed to register a ServiceWorker: The script has an unsupported MIME type ('text/x-javascript')."
Registering script that imports script with good MIME type text/x-javascript PASS
Registering script that imports script with no MIME type FAIL assert_unreached: Should have rejected: Registration of no MIME type imported script should fail. Reached unreachable code
Registering script that imports script with bad MIME type FAIL assert_unreached: Should have rejected: Registration of plain text imported script should fail. Reached unreachable code
Registering redirected script PASS
Registering script including parse error PASS
Registering script including undefined error PASS
Registering script including uncaught exception PASS
Registering script including caught exception PASS
Registering script importing malformed script PASS
Registering script importing non-existent script PASS
Scope including URL-encoded multibyte characters PASS
Scope including non-escaped multibyte characters PASS
Script URL including URL-encoded slash PASS
Script URL including uppercase URL-encoded slash PASS
Scope including URL-encoded slash PASS
Script URL including URL-encoded backslash PASS
Script URL including uppercase URL-encoded backslash PASS
Scope including URL-encoded backslash PASS
Script URL including self-reference PASS
Scope including self-reference PASS
Script URL including parent-reference PASS
Scope including parent-reference PASS
Scope including parent-reference and not under the script directory PASS
Script URL including consecutive slashes PASS
Scope including consecutive slashes PASS
Script URL is same-origin filesystem: URL PASS
Scope URL is same-origin filesystem: URL PASS

@ghost
Copy link
Copy Markdown

ghost commented Apr 5, 2017

These tests are now available on w3c-test.org

@jakearchibald
Copy link
Copy Markdown
Contributor Author

importScripts tests added. Interestingly both Firefox & Chrome don't apply mimetype checking to imported scripts here. Heading out of the office but will file bugs.

@jakearchibald
Copy link
Copy Markdown
Contributor Author

@wanderview do these tests look good to you?

@wanderview
Copy link
Copy Markdown
Member

LGTM

@annevk annevk merged commit 598c1dd into web-platform-tests:master Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants