[HTML5] Make Mochitest run all html5lib tree builder tests

RESOLVED FIXED in mozilla2.0b7

Status

()

Core
HTML: Parser
P3
normal
RESOLVED FIXED
8 years ago
7 years ago

People

(Reporter: hsivonen, Assigned: hsivonen)

Tracking

Trunk
mozilla2.0b7
x86
All
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

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

Attachments

(4 attachments, 2 obsolete attachments)

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.
Priority: -- → P3
Created attachment 472367 [details] [diff] [review]
Part 1: Move the html5lib test data file into a directory of their own

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)
Created attachment 472605 [details] [diff] [review]
Part 1: Move the html5lib test data file into a directory of their own, using .dat extension this time
Attachment #472605 - Flags: review?(jonas)
Created attachment 474711 [details] [diff] [review]
Part 2: Import new test data and adjust the harness to deal

Need to push this to try still to see if it times out, etc...
Created attachment 475020 [details] [diff] [review]
Part 2: Import new test data and adjust the harness to deal, with bug numbers for the remaining failing tests in comments

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)
Created attachment 477112 [details] [diff] [review]
Part 0: Revert firefight changeset b439e73f33b7 to make parts 1 and 2 apply

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+
Created attachment 480881 [details] [diff] [review]
Part 3: WebKit contributions introduced during the m-c beta 7 tree closure
Attachment #480881 - Flags: review?(jgriffin)
(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.