Closed Bug 559023 Opened 14 years ago Closed 14 years ago

[HTML5] Make Mochitest run all html5lib tree builder tests

Categories

(Core :: DOM: HTML Parser, defect, P3)

x86
All
defect

Tracking

()

RESOLVED FIXED
mozilla2.0b7

People

(Reporter: hsivonen, Assigned: hsivonen)

References

()

Details

(Whiteboard: [ready to land if bug 595797 gets approval])

Attachments

(4 files, 2 obsolete files)

Steps to reproduce:
 1) Load http://mxr-test.konigsberg.mozilla.org/mozilla-central/find?string=html5lib_tree&tree=mozilla-central&hint=
 2) Load http://code.google.com/p/html5lib/source/browse/#hg/testdata/tree-construction
 3) Load http://mxr-test.konigsberg.mozilla.org/mozilla-central/source/parser/htmlparser/tests/mochitest/html5_tree_construction_exceptions.js?force=1
 4) Run the tree tests using the Java version of the parser.

Actual results:
There are 3 html5lib tree test files in mozilla-central but there are 15 test files in the upstream repo.

The Java version of the parser fails 2 tree builder tests (bug ) but the exception file has many more exceptions.

Expected results:
Expected to see the same file in m-c and upstream. Expected the exception file to have 2 entries.
The missing bug number was supposed to be bug 525960.
Since this upstream stuff available under a different license than most m-c stuff (MIT), I think it's more manageable to have the upstream files in a directory of their own.
Assignee: nobody → hsivonen
Status: NEW → ASSIGNED
Attachment #472367 - Flags: review?(jonas)
Attachment #472367 - Attachment is obsolete: true
Attachment #472367 - Flags: review?(jonas)
Need to push this to try still to see if it times out, etc...
I changed the loading mechanism to XHR, because loading into an iframe tampers with \0 and \r.

I changed the data: URLs to percent encoding to support UTF-8. (The harness previously only worked with ASCII.)

I changed the tree printing format to the canonical html5lib format, because previously the harness was unable to deal with two consecutive line breaks within a text node in the expected DOM.

I changed the attribute shuffling to attribute sorting, because the test format has a well-defined sort order, so the order of expected attributes isn't arbitrary.

The test data never uses the "otherns" namespace marker, so if the actual results are serialized with "otherns", the result will not match, which is intentional.
Attachment #474711 - Attachment is obsolete: true
Attachment #475020 - Flags: review?(jonas)
Making all bugs whose test cases are in here depend on this bug.
I don't think we want to add a general mapping for .dat files. At least you'd have to get reviews from others than me.

Either add ^headers^ files which set the content type, or stick with .txt if possible.
Comment on attachment 472605 [details] [diff] [review]
Part 1: Move the html5lib test data file into a directory of their own, using .dat extension this time

I suspect it'd be better to get review from someone that knows our testing infrastructure better than I do.
Attachment #472605 - Flags: review?(jonas) → review?(jgriffin)
Attachment #475020 - Flags: review?(jonas) → review?(jgriffin)
This patch undoes a firefight orange fix to make parts 1 and 2 apply. It seems easier to do this that to rebase parts 1 and 2.
Attachment #477112 - Flags: review?(jgriffin)
Comment on attachment 472605 [details] [diff] [review]
Part 1: Move the html5lib test data file into a directory of their own, using .dat extension this time

The changes look fine to me.  Adding a text/plain mapping for .dat files is ok, since it doesn't impact any other tests.

Note that when I ran these tests with the latest trunk build, 5 failed for me.
Attachment #472605 - Flags: review?(jgriffin) → review+
Attachment #475020 - Flags: review?(jgriffin) → review+
Attachment #477112 - Flags: review?(jgriffin) → review+
(In reply to comment #10)
> Note that when I ran these tests with the latest trunk build, 5 failed for me.

To succeed, fixes for some of the bugs marked as depending on this one need to be applied.
Attachment #480881 - Flags: review?(jgriffin) → review+
Whiteboard: [ready to land if bug 595797 gets approval]
Target Milestone: mozilla2.0b8 → mozilla2.0b7
You need to log in before you can comment on or make changes to this bug.