Closed Bug 1323967 Opened 8 years ago Closed 8 years ago

Improve how Worklet tests are written

Categories

(Core :: DOM: Core & HTML, defect)

50 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla53
Tracking Status
firefox53 --- fixed

People

(Reporter: baku, Assigned: baku)

Details

Attachments

(1 file)

      No description provided.
Attached patch 02_tests.patchSplinter Review
Assignee: nobody → amarchesini
Attachment #8819270 - Flags: review?(bugs)
Comment on attachment 8819270 [details] [diff] [review]
02_tests.patch

You have some dump()s in the patch. Please remove those


>-  document.body.appendChild(iframe);
>+function setupTest() {
> }
What is this dummy function about?


>-function setupTest() {
>+window.onload = function() {
>+  SimpleTest.waitForExplicitFinish();
Doesn't look right to call waitForExplicitFinish both in parent and child.
Don't we want this only in parent.


>+  return SpecialPowers.pushPrefEnv(
>+    {"set": [["dom.paintWorklet.enabled", true],
>+             ["dom.worklet.enabled", true]]});
> }
> 
>-var cl = new consoleListener();
>-
>-SimpleTest.waitForExplicitFinish();
>-SpecialPowers.pushPrefEnv(
>-  {"set": [["dom.paintWorklet.enabled", true],
>-           ["dom.worklet.enabled", true]]},
>-  function() { loadTest("file_paintWorklet.html"); });
>-
>+function runTest() {
>+  paintWorklet.import("worklet_paintWorklet.js")
>+}
How does this work. We create the global for this page and at that point  dom.paintWorklet.enabled is false. But somehow we then get access to window.paintWorklet here?
... oh this is confusing. We load the same page in iframe, but runTest is only run in an iframe.
Please add some comment somewhere... I guess to each runTest() function. Or rename the function to something which hints where it will be used.
Attachment #8819270 - Flags: review?(bugs) → review+
Pushed by amarchesini@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/f380b1052f2a
Improve how Worklet tests are written, r=smaug
https://hg.mozilla.org/mozilla-central/rev/f380b1052f2a
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: