Closed
Bug 1140791
Opened 10 years ago
Closed 10 years ago
Run fetch tests on main thread too
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla39
Tracking | Status | |
---|---|---|
firefox39 | --- | fixed |
People
(Reporter: nsm, Assigned: nsm)
References
Details
Attachments
(1 file)
54.04 KB,
patch
|
ehsan.akhgari
:
review+
|
Details | Diff | Splinter Review |
Right now most tests are only run on workers, they should be run in both threads. This should be pretty easy with some refactoring.
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → nsm.nikhil
Assignee | ||
Comment 1•10 years ago
|
||
Unified all tests into dom/tests/mochitest/fetch
Moved test runner into fetch_test_framework. The common header tests also use this framework, while the main thread tests now have their own html file.
Attachment #8576277 -
Flags: review?(bkelly)
Comment 2•10 years ago
|
||
Comment on attachment 8576277 [details] [diff] [review]
Run fetch tests on main thread and workers
Redirecting to Ehsan as we need a DOM peer to sign off anyways and he has been looking at this kind of test framework stuff recently.
Attachment #8576277 -
Flags: review?(bkelly) → review?(ehsan)
Comment 3•10 years ago
|
||
What features does your framework provide, Nikhil? I have been developing my own little framework for cache too (it's https://dxr.mozilla.org/mozilla-central/source/dom/cache/test/mochitest/driver.js) that knows how to run a test in a worker, a service worker and a window, and I'm extending it to do exciting things such as interleave the tests run in the three threads in bug 1142772. Maybe we should consider unifying them?
Flags: needinfo?(nsm.nikhil)
Assignee | ||
Comment 4•10 years ago
|
||
My 'framework' is no framework. It just loads a script in 1) main thread 2) a worker, calls a function on them, and waits for the promise to resolve. Nothing to do with serviceworkers. I guess I could use some part of it, but this is a 20 line test runner and I'd rather not spend the time right now figuring out how to integrate with the cache driver. I particularly do not want interleaving since the fetch tests test for cookies which need ordering.
Flags: needinfo?(nsm.nikhil)
Comment 5•10 years ago
|
||
OK fair enough!
Comment 6•10 years ago
|
||
Comment on attachment 8576277 [details] [diff] [review]
Run fetch tests on main thread and workers
Review of attachment 8576277 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/tests/mochitest/fetch/fetch_test_framework.js
@@ +5,5 @@
> + worker.onmessage = function(event) {
> + if (event.data.type == 'finish') {
> + resolve();
> + } else if (event.data.type == 'status') {
> + ok(event.data.status, event.data.msg);
Nit: please prepend "Worker: " or some such to the message here.
@@ +9,5 @@
> + ok(event.data.status, event.data.msg);
> + }
> + }
> + worker.onerror = function(event) {
> + info("Got worker error!");
Nit: indentation.
Attachment #8576277 -
Flags: review?(ehsan) → review+
Assignee | ||
Comment 7•10 years ago
|
||
Comment 8•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
status-firefox39:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•