Open
Bug 1248119
Opened 8 years ago
Updated 2 years ago
Use testharness.js for the MathML script tests
Categories
(Core :: MathML, defect)
Core
MathML
Tracking
()
NEW
Tracking | Status | |
---|---|---|
firefox47 | --- | affected |
People
(Reporter: fredw, Unassigned)
References
()
Details
Attachments
(2 files)
46.29 KB,
patch
|
fredw
:
review+
|
Details | Diff | Splinter Review |
23.39 KB,
patch
|
fredw
:
review+
|
Details | Diff | Splinter Review |
Follow-up of bug 1240799 comment 5. We currently have several MathML "script" tests defining similar testing functions. We could instead just use the API from testharness.js so that we avoid duplicating code. This will also make easier to share the tests with the testthewebforward project (or for now tests.mathml-association.org) or with other rendering engines. See also https://bugs.webkit.org/show_bug.cgi?id=154065 for the corresponding bug entry in WebKit.
Comment 1•8 years ago
|
||
Minimal changes were needed to get the tests from bug 1240799 description work as mochitest-plain tests. I'll work on converting the other in-tree script tests.
Assignee: nobody → jkitch.bug
Comment 2•8 years ago
|
||
Mochitests converted to testharness. Not all were suitable for conversion. Some invoke special powers or preference manipulation.
Attachment #8738493 -
Flags: review?(fred.wang)
Comment 3•8 years ago
|
||
I've looked over the reftests and identified 4 which are suitable for conversion. These are the dynamic ones which do not manipulate preferences and do not require mozReftestInvalidate.
Attachment #8738496 -
Flags: review?(fred.wang)
Reporter | ||
Comment 4•8 years ago
|
||
Comment on attachment 8738493 [details] [diff] [review] Mochitest conversions Review of attachment 8738493 [details] [diff] [review]: ----------------------------------------------------------------- ::: layout/mathml/tests/test_opentype-axis-height.html @@ +24,5 @@ > function getBox(aId) { > return document.getElementById(aId).getBoundingClientRect(); > } > > + var test_loaded = async_test("Page Loaded"); For this and other tests, you can actually use setup({ explicit_done: true }); and then replace test_loaded.done(); with done(); @@ +26,5 @@ > } > > + var test_loaded = async_test("Page Loaded"); > + window.addEventListener("load", function() { > + runTests(); Maybe waiting for web fonts with document.fonts.ready.then(runTests); will give more reliable result.
Attachment #8738493 -
Flags: review?(fred.wang) → review+
Reporter | ||
Comment 5•8 years ago
|
||
Comment on attachment 8738496 [details] [diff] [review] Reftest conversions Review of attachment 8738496 [details] [diff] [review]: ----------------------------------------------------------------- ::: layout/mathml/tests/test_stretchy-largeop-3.html @@ +130,5 @@ > + var numTests = 10; // zero indexed > + var opPrefix = "mo"; > + var refPrefix = "moRef"; > + var epsilon = 2; > + extra tab ::: layout/mathml/tests/test_subscript-italic-correction.html @@ +47,5 @@ > + var sup = "s" + (i+1); > + var italicCorrection = boxLeft(sup) - boxLeft(sub); > + tests.push([sub + " vs " + sup, italicCorrection >= epsilon]); > + } > + extra tab
Attachment #8738496 -
Flags: review?(fred.wang) → review+
Comment 6•8 years ago
|
||
Note that for running these tests as web-platform-tests in the Mozilla tree we can set a pref for the lifetime of the test using the ini file; see [1]. I don't know if that helps with any of the cases you couldn't convert, or if they are specifically testing the behaviour when a pref is changed at runtime. Note also what an advantage it would be to upstream these to web-platform-tests directly where all this machinery is already in place. [1] https://developer.mozilla.org/en-US/docs/Mozilla/QA/web-platform-tests#Setting_prefs
Comment 7•8 years ago
|
||
That should help one test. Where would the tests live within the web-platform-test hierarchy? I have not been able to find any non-trivial uses of MathML.
Comment 8•8 years ago
|
||
Under /mathml/ presumably. That doesn't exist yet, but there's no reason it shouldn't.
Comment 9•2 years ago
|
||
The bug assignee didn't login in Bugzilla in the last 7 months, so the assignee is being reset.
Assignee: jkitch.bug → nobody
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•