haikuwebkit/LayoutTests/html5lib/webkit-resumer.html

239 lines
7.6 KiB
HTML
Raw Permalink Normal View History

2010-05-26 Adam Barth <abarth@webkit.org> Reviewed by Eric Seidel. Make HTML5 lexer not ASSERT when resuming partial parses https://bugs.webkit.org/show_bug.cgi?id=39755 Add a test suite for partial parsing. This test runs all our parsing test cases, but stops and starts the parser at every character in the parse stream to make sure we resume parsing properly. Currently, a bunch of the test cases are commented out, but I'll comment them back in as I get them running. * html5lib/webkit-resumer-expected-html5.txt: Added. * html5lib/webkit-resumer-expected.txt: Added. * html5lib/webkit-resumer.html: Added. 2010-05-26 Adam Barth <abarth@webkit.org> Reviewed by Eric Seidel. Make HTML5 lexer not ASSERT when resuming partial parses https://bugs.webkit.org/show_bug.cgi?id=39755 I'm working through a variation of the webkit-runner.html test suite that stops the parser at every character to make sure we can resume parsing correctly. This patch fixes some errors caught by ASSERTs, which prevent the basic tests from running to completion. There's a bunch more work to do, however. Test: html5lib/webkit-resumer.html * html/HTML5Lexer.cpp: (WebCore::HTMLNames::isEndTagBufferingState): (WebCore::HTML5Lexer::nextToken): (WebCore::HTML5Lexer::addToPossibleEndTag): * html/HTML5Lexer.h: * html/HTML5Tokenizer.cpp: (WebCore::HTML5Tokenizer::write): * html/HTML5Tokenizer.h: 2010-05-26 Adam Barth <abarth@webkit.org> Reviewed by Eric Seidel. Make HTML5 lexer not ASSERT when resuming partial parses https://bugs.webkit.org/show_bug.cgi?id=39755 Add webkit-resumer.html to the HTML5 parser test suite. * Scripts/test-html5-parser: Canonical link: https://commits.webkit.org/51304@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@60253 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-05-26 21:51:01 +00:00
<title>html5lib test runner</title>
<script>
// Copyright (c) 2008 Geoffrey Sneddon
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
</script>
2010-07-27 Ojan Vafai <ojan@chromium.org> Reviewed by Adam Barth. dump-as-markup should have better output https://bugs.webkit.org/show_bug.cgi?id=43015 -Merge dom2string into dump-as-markup and pull over all dom2string features (e.g. indent). -#-prefix selection markers * editing/deleting/delete-br-in-last-table-cell-expected.txt: * editing/execCommand/crash-indenting-list-item-expected.txt: * editing/execCommand/crash-on-enter-in-contentEditable-list-expected.txt: * editing/execCommand/create-list-from-range-selection-expected.txt: * editing/execCommand/hilitecolor-expected.txt: * editing/execCommand/indent-pre-expected.txt: * editing/execCommand/insert-list-empty-div-expected.txt: * editing/selection/dump-as-markup-expected.txt: * editing/selection/dump-as-markup.html: * editing/selection/home-inside-noneditable-table-expected.txt: * editing/style/remove-underline-from-stylesheet-expected.txt: * editing/style/style-text-node-without-editable-parent-expected.txt: * editing/undo/redo-split-text-node-expected.txt: * editing/undo/redo-split-text-with-removal-expected.txt: * html5lib/resources/dom2string.js: Removed. * html5lib/resources/tests4.dat: * html5lib/resources/tests6.dat: * html5lib/runner-expected.txt: * html5lib/runner.html: * html5lib/webkit-resumer.html: * resources/dump-as-markup.js: (Markup.notifyDone): (Markup._get): (Markup._namespace): (Markup._dumpCalls.0.Markup._indent): (Markup._toAsciiLowerCase): (Markup._getMarkupForTextNode): (Markup._getSelectionMarker): Canonical link: https://commits.webkit.org/55126@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@64303 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-07-29 20:16:52 +00:00
<script src=../resources/dump-as-markup.js></script>
2010-05-26 Adam Barth <abarth@webkit.org> Reviewed by Eric Seidel. Make HTML5 lexer not ASSERT when resuming partial parses https://bugs.webkit.org/show_bug.cgi?id=39755 Add a test suite for partial parsing. This test runs all our parsing test cases, but stops and starts the parser at every character in the parse stream to make sure we resume parsing properly. Currently, a bunch of the test cases are commented out, but I'll comment them back in as I get them running. * html5lib/webkit-resumer-expected-html5.txt: Added. * html5lib/webkit-resumer-expected.txt: Added. * html5lib/webkit-resumer.html: Added. 2010-05-26 Adam Barth <abarth@webkit.org> Reviewed by Eric Seidel. Make HTML5 lexer not ASSERT when resuming partial parses https://bugs.webkit.org/show_bug.cgi?id=39755 I'm working through a variation of the webkit-runner.html test suite that stops the parser at every character to make sure we can resume parsing correctly. This patch fixes some errors caught by ASSERTs, which prevent the basic tests from running to completion. There's a bunch more work to do, however. Test: html5lib/webkit-resumer.html * html/HTML5Lexer.cpp: (WebCore::HTMLNames::isEndTagBufferingState): (WebCore::HTML5Lexer::nextToken): (WebCore::HTML5Lexer::addToPossibleEndTag): * html/HTML5Lexer.h: * html/HTML5Tokenizer.cpp: (WebCore::HTML5Tokenizer::write): * html/HTML5Tokenizer.h: 2010-05-26 Adam Barth <abarth@webkit.org> Reviewed by Eric Seidel. Make HTML5 lexer not ASSERT when resuming partial parses https://bugs.webkit.org/show_bug.cgi?id=39755 Add webkit-resumer.html to the HTML5 parser test suite. * Scripts/test-html5-parser: Canonical link: https://commits.webkit.org/51304@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@60253 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-05-26 21:51:01 +00:00
<style>
.overview:hover {
background: #ccc;
}
iframe {
display: none;
}
</style>
<p>Script did not run</p>
<iframe></iframe>
<script>
Fonts, fullscreen, gamepad, and html5lib tests should use testRunner instead of layoutTestController https://bugs.webkit.org/show_bug.cgi?id=88959 Reviewed by Darin Adler. * fonts/valid-standard-font.html: * fullscreen/anonymous-block-merge-crash.html: * fullscreen/full-screen-element-stack.html: * fullscreen/full-screen-frameset.html: * fullscreen/full-screen-iframe-zIndex.html: * fullscreen/full-screen-keyboard-disabled.html: * fullscreen/full-screen-keyboard-enabled.html: * fullscreen/full-screen-remove-ancestor-during-transition.html: * fullscreen/full-screen-remove-sibling.html: * fullscreen/full-screen-render-inline.html: * fullscreen/full-screen-request-rejected.html: * fullscreen/full-screen-request-removed.html: * fullscreen/full-screen-restrictions.html: * fullscreen/full-screen-stacking-context.html: * fullscreen/full-screen-test.js: (runWithKeyDown): (endTest): * fullscreen/full-screen-zIndex-after.html: * fullscreen/full-screen-zIndex.html: * fullscreen/non-ancestor-iframe.html: * fullscreen/parent-flow-inline-with-block-child.html: * fullscreen/video-controls-override.html: * html5lib/resources/runner.js: (run): * html5lib/webkit-resumer.html: * platform/gtk/fonts/custom-font-missing-glyphs.html: * platform/gtk/fonts/font-face-with-complex-text.html: * platform/gtk/fonts/font-family-fallback.html: * platform/gtk/fonts/synthetic-oblique-positioning.html: Canonical link: https://commits.webkit.org/106812@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@120190 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-06-13 12:34:26 +00:00
if (window.testRunner)
testRunner.waitUntilDone();
2010-07-27 Ojan Vafai <ojan@chromium.org> Reviewed by Adam Barth. dump-as-markup should have better output https://bugs.webkit.org/show_bug.cgi?id=43015 -Merge dom2string into dump-as-markup and pull over all dom2string features (e.g. indent). -#-prefix selection markers * editing/deleting/delete-br-in-last-table-cell-expected.txt: * editing/execCommand/crash-indenting-list-item-expected.txt: * editing/execCommand/crash-on-enter-in-contentEditable-list-expected.txt: * editing/execCommand/create-list-from-range-selection-expected.txt: * editing/execCommand/hilitecolor-expected.txt: * editing/execCommand/indent-pre-expected.txt: * editing/execCommand/insert-list-empty-div-expected.txt: * editing/selection/dump-as-markup-expected.txt: * editing/selection/dump-as-markup.html: * editing/selection/home-inside-noneditable-table-expected.txt: * editing/style/remove-underline-from-stylesheet-expected.txt: * editing/style/style-text-node-without-editable-parent-expected.txt: * editing/undo/redo-split-text-node-expected.txt: * editing/undo/redo-split-text-with-removal-expected.txt: * html5lib/resources/dom2string.js: Removed. * html5lib/resources/tests4.dat: * html5lib/resources/tests6.dat: * html5lib/runner-expected.txt: * html5lib/runner.html: * html5lib/webkit-resumer.html: * resources/dump-as-markup.js: (Markup.notifyDone): (Markup._get): (Markup._namespace): (Markup._dumpCalls.0.Markup._indent): (Markup._toAsciiLowerCase): (Markup._getMarkupForTextNode): (Markup._getSelectionMarker): Canonical link: https://commits.webkit.org/55126@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@64303 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-07-29 20:16:52 +00:00
Markup.noAutoDump();
Markup.useHTML5libOutputFormat();
2010-07-27 Ojan Vafai <ojan@chromium.org> Reviewed by Adam Barth. dump-as-markup should have better output https://bugs.webkit.org/show_bug.cgi?id=43015 -Merge dom2string into dump-as-markup and pull over all dom2string features (e.g. indent). -#-prefix selection markers * editing/deleting/delete-br-in-last-table-cell-expected.txt: * editing/execCommand/crash-indenting-list-item-expected.txt: * editing/execCommand/crash-on-enter-in-contentEditable-list-expected.txt: * editing/execCommand/create-list-from-range-selection-expected.txt: * editing/execCommand/hilitecolor-expected.txt: * editing/execCommand/indent-pre-expected.txt: * editing/execCommand/insert-list-empty-div-expected.txt: * editing/selection/dump-as-markup-expected.txt: * editing/selection/dump-as-markup.html: * editing/selection/home-inside-noneditable-table-expected.txt: * editing/style/remove-underline-from-stylesheet-expected.txt: * editing/style/style-text-node-without-editable-parent-expected.txt: * editing/undo/redo-split-text-node-expected.txt: * editing/undo/redo-split-text-with-removal-expected.txt: * html5lib/resources/dom2string.js: Removed. * html5lib/resources/tests4.dat: * html5lib/resources/tests6.dat: * html5lib/runner-expected.txt: * html5lib/runner.html: * html5lib/webkit-resumer.html: * resources/dump-as-markup.js: (Markup.notifyDone): (Markup._get): (Markup._namespace): (Markup._dumpCalls.0.Markup._indent): (Markup._toAsciiLowerCase): (Markup._getMarkupForTextNode): (Markup._getSelectionMarker): Canonical link: https://commits.webkit.org/55126@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@64303 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-07-29 20:16:52 +00:00
2010-05-26 Adam Barth <abarth@webkit.org> Reviewed by Eric Seidel. Make HTML5 lexer not ASSERT when resuming partial parses https://bugs.webkit.org/show_bug.cgi?id=39755 Add a test suite for partial parsing. This test runs all our parsing test cases, but stops and starts the parser at every character in the parse stream to make sure we resume parsing properly. Currently, a bunch of the test cases are commented out, but I'll comment them back in as I get them running. * html5lib/webkit-resumer-expected-html5.txt: Added. * html5lib/webkit-resumer-expected.txt: Added. * html5lib/webkit-resumer.html: Added. 2010-05-26 Adam Barth <abarth@webkit.org> Reviewed by Eric Seidel. Make HTML5 lexer not ASSERT when resuming partial parses https://bugs.webkit.org/show_bug.cgi?id=39755 I'm working through a variation of the webkit-runner.html test suite that stops the parser at every character to make sure we can resume parsing correctly. This patch fixes some errors caught by ASSERTs, which prevent the basic tests from running to completion. There's a bunch more work to do, however. Test: html5lib/webkit-resumer.html * html/HTML5Lexer.cpp: (WebCore::HTMLNames::isEndTagBufferingState): (WebCore::HTML5Lexer::nextToken): (WebCore::HTML5Lexer::addToPossibleEndTag): * html/HTML5Lexer.h: * html/HTML5Tokenizer.cpp: (WebCore::HTML5Tokenizer::write): * html/HTML5Tokenizer.h: 2010-05-26 Adam Barth <abarth@webkit.org> Reviewed by Eric Seidel. Make HTML5 lexer not ASSERT when resuming partial parses https://bugs.webkit.org/show_bug.cgi?id=39755 Add webkit-resumer.html to the HTML5 parser test suite. * Scripts/test-html5-parser: Canonical link: https://commits.webkit.org/51304@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@60253 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-05-26 21:51:01 +00:00
var test_files = [
// 'resources/tests1.dat',
// 'resources/tests2.dat',
// 'resources/tests3.dat',
// 'resources/tests4.dat',
// 'resources/tests5.dat',
// 'resources/tests6.dat',
// 'resources/tests7.dat',
// 'resources/tests8.dat',
// 'resources/tests9.dat',
// 'resources/tests10.dat',
// 'resources/tests11.dat',
// 'resources/tests12.dat',
// 'resources/tests14.dat',
// 'resources/tests15.dat',
// 'resources/tests16.dat',
'resources/webkit01.dat',
// 'resources/doctype01.dat',
// 'resources/scriptdata01.dat',
// 'resources/entities01.dat',
// 'resources/comments01.dat'
],
tests = [],
iframe = document.getElementsByTagName("iframe")[0],
stat = document.getElementsByTagName("p")[0].firstChild,
file = "",
test_number = 1,
subtest_number = 0,
fail_list = [],
log = "";
iframe.contentWindow.document.open()
iframe.contentWindow.document.write("Test");
iframe.contentWindow.document.close();
var write = iframe.contentWindow.document.lastChild.lastChild.lastChild !== null;
var ignoreTitle = iframe.contentWindow.document.getElementsByTagName("title")[0] !== undefined;
window.onload = function()
{
stat.data = "Running";
run();
}
function run()
{
var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
if (file = test_files.shift())
{
stat.data = "Retriving " + file;
test_number = 1;
fail_list = [];
log = "";
xhr.open("GET", file);
xhr.onreadystatechange = function()
{
if (xhr.readyState === 4)
{
tests = xhr.responseText.split(/(?:^|\n\n)#data\n/);
tests.shift();
test();
}
}
xhr.send(null);
2011-06-13 Nate Chapin <japhet@chromium.org> Reviewed by Adam Barth. Rewrite a bunch of XHR-based tests to use waitUntilDone()/notifyDone(). https://bugs.webkit.org/show_bug.cgi?id=62066 * fast/xmlhttprequest/xmlhttprequest-gc.html: * fast/xmlhttprequest/xmlhttprequest-get.xhtml: * fast/xmlhttprequest/xmlhttprequest-html-response-encoding.html: * html5lib/runner.html: * html5lib/webkit-resumer.html: * http/tests/xmlhttprequest/access-control-basic-denied-preflight-cache.html: * http/tests/xmlhttprequest/access-control-basic-non-simple-allow-async.html: * http/tests/xmlhttprequest/access-control-preflight-async-header-denied.html: * http/tests/xmlhttprequest/access-control-preflight-async-method-denied.html: * http/tests/xmlhttprequest/access-control-preflight-async-not-supported.html: * http/tests/xmlhttprequest/cross-origin-preflight-get.html: * http/tests/xmlhttprequest/event-listener-gc.html: * http/tests/xmlhttprequest/interactive-state.html: * http/tests/xmlhttprequest/resources/uri-resolution-opera-open-004-iframe.html: * http/tests/xmlhttprequest/resources/uri-resolution-opera-open-005-iframe.html: * http/tests/xmlhttprequest/resources/uri-resolution-opera-open-006-iframe.html: * http/tests/xmlhttprequest/resources/uri-resolution-opera-open-007-iframe.html: * http/tests/xmlhttprequest/resources/uri-resolution-opera-open-008-iframe.html: * http/tests/xmlhttprequest/resources/uri-resolution-opera-open-009-iframe.html: * http/tests/xmlhttprequest/resources/uri-resolution-opera-open-010-iframe.html: * http/tests/xmlhttprequest/response-encoding.html: * http/tests/xmlhttprequest/simple-cross-origin-progress-events.html: * http/tests/xmlhttprequest/uri-resolution-opera-open-004.html: * http/tests/xmlhttprequest/uri-resolution-opera-open-005.html: * http/tests/xmlhttprequest/uri-resolution-opera-open-006.html: * http/tests/xmlhttprequest/uri-resolution-opera-open-007.html: * http/tests/xmlhttprequest/uri-resolution-opera-open-008.html: * http/tests/xmlhttprequest/uri-resolution-opera-open-009.html: * http/tests/xmlhttprequest/uri-resolution-opera-open-010.html: * http/tests/xmlhttprequest/web-apps/001.html: * http/tests/xmlhttprequest/xmlhttprequest-50ms-download-dispatch.html: * http/tests/xmlhttprequest/xmlhttprequest-crlf-getAllResponseHeader.html: * http/tests/xmlhttprequest/xmlhttprequest-unsafe-redirect.html: * http/tests/xmlhttprequest/zero-length-response.html: Canonical link: https://commits.webkit.org/78111@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@88709 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-06-13 22:22:16 +00:00
} else {
Fonts, fullscreen, gamepad, and html5lib tests should use testRunner instead of layoutTestController https://bugs.webkit.org/show_bug.cgi?id=88959 Reviewed by Darin Adler. * fonts/valid-standard-font.html: * fullscreen/anonymous-block-merge-crash.html: * fullscreen/full-screen-element-stack.html: * fullscreen/full-screen-frameset.html: * fullscreen/full-screen-iframe-zIndex.html: * fullscreen/full-screen-keyboard-disabled.html: * fullscreen/full-screen-keyboard-enabled.html: * fullscreen/full-screen-remove-ancestor-during-transition.html: * fullscreen/full-screen-remove-sibling.html: * fullscreen/full-screen-render-inline.html: * fullscreen/full-screen-request-rejected.html: * fullscreen/full-screen-request-removed.html: * fullscreen/full-screen-restrictions.html: * fullscreen/full-screen-stacking-context.html: * fullscreen/full-screen-test.js: (runWithKeyDown): (endTest): * fullscreen/full-screen-zIndex-after.html: * fullscreen/full-screen-zIndex.html: * fullscreen/non-ancestor-iframe.html: * fullscreen/parent-flow-inline-with-block-child.html: * fullscreen/video-controls-override.html: * html5lib/resources/runner.js: (run): * html5lib/webkit-resumer.html: * platform/gtk/fonts/custom-font-missing-glyphs.html: * platform/gtk/fonts/font-face-with-complex-text.html: * platform/gtk/fonts/font-family-fallback.html: * platform/gtk/fonts/synthetic-oblique-positioning.html: Canonical link: https://commits.webkit.org/106812@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@120190 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-06-13 12:34:26 +00:00
if (window.testRunner)
testRunner.notifyDone();
2010-05-26 Adam Barth <abarth@webkit.org> Reviewed by Eric Seidel. Make HTML5 lexer not ASSERT when resuming partial parses https://bugs.webkit.org/show_bug.cgi?id=39755 Add a test suite for partial parsing. This test runs all our parsing test cases, but stops and starts the parser at every character in the parse stream to make sure we resume parsing properly. Currently, a bunch of the test cases are commented out, but I'll comment them back in as I get them running. * html5lib/webkit-resumer-expected-html5.txt: Added. * html5lib/webkit-resumer-expected.txt: Added. * html5lib/webkit-resumer.html: Added. 2010-05-26 Adam Barth <abarth@webkit.org> Reviewed by Eric Seidel. Make HTML5 lexer not ASSERT when resuming partial parses https://bugs.webkit.org/show_bug.cgi?id=39755 I'm working through a variation of the webkit-runner.html test suite that stops the parser at every character to make sure we can resume parsing correctly. This patch fixes some errors caught by ASSERTs, which prevent the basic tests from running to completion. There's a bunch more work to do, however. Test: html5lib/webkit-resumer.html * html/HTML5Lexer.cpp: (WebCore::HTMLNames::isEndTagBufferingState): (WebCore::HTML5Lexer::nextToken): (WebCore::HTML5Lexer::addToPossibleEndTag): * html/HTML5Lexer.h: * html/HTML5Tokenizer.cpp: (WebCore::HTML5Tokenizer::write): * html/HTML5Tokenizer.h: 2010-05-26 Adam Barth <abarth@webkit.org> Reviewed by Eric Seidel. Make HTML5 lexer not ASSERT when resuming partial parses https://bugs.webkit.org/show_bug.cgi?id=39755 Add webkit-resumer.html to the HTML5 parser test suite. * Scripts/test-html5-parser: Canonical link: https://commits.webkit.org/51304@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@60253 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-05-26 21:51:01 +00:00
}
}
function test()
{
var input, errorsStart, fragmentStart, contextElement, domStart, dom;
if (data = tests.shift())
{
subtest_number = 0;
stat.data = "Running test " + test_number + " of " + (test_number + tests.length) + " in " + file;
errorsStart = data.indexOf("\n#errors\n");
if (errorsStart !== -1)
{
input = data.substring(0, errorsStart);
fragmentStart = data.indexOf("\n#document-fragment\n")
domStart = data.indexOf("\n#document\n")
if (fragmentStart !== -1)
{
contextElement = data.substring(fragmentStart + 20, domStart);
}
if (domStart !== -1)
{
dom = data.substring(domStart + 11);
if (dom.substring(dom.length - 1) === "\n")
{
dom = dom.substring(0, dom.length - 1);
}
run_test(input, contextElement, dom);
return;
}
}
alert("Invalid test: " + data);
test();
return;
}
else
{
stat.data = "Finished running " + file;
var overview = document.createElement("p");
if (fail_list.length)
{
overview.innerHTML = file + ":<br>" + fail_list.join("<br>");
overview.className = "overview";
overview.title = "Click for more details";
overview.onclick = function()
{
this.nextSibling.style.display = this.nextSibling.style.display == "none" ? "block" : "none";
}
var detail = document.createElement("pre");
detail.appendChild(document.createTextNode(log.substring(2)));
detail.style.display = "none";
document.body.appendChild(overview);
document.body.appendChild(detail);
}
else
{
overview.innerHTML = file + ": PASS";
document.body.appendChild(overview);
}
stat.data = "";
run();
}
}
function run_test(input, contextElement, expected)
{
while (++subtest_number < input.length) {
lower_input = input.substring(0, subtest_number);
upper_input = input.substring(subtest_number, input.length);
if (contextElement)
{
var element = document.createElement(contextElement);
try
{
element.innerHTML = input;
}
catch(e) {}
process_result(input, element, expected);
}
else if (write)
{
iframe.contentWindow.document.open();
try
{
iframe.contentWindow.document.write(lower_input);
iframe.contentWindow.document.write(upper_input);
}
catch(e) {}
iframe.contentWindow.document.close();
if (ignoreTitle)
{
var title = iframe.contentWindow.document.getElementsByTagName("title")[0];
if (!title.innerHTML)
{
title.parentElement.removeChild(title);
}
}
process_result(input, iframe.contentWindow.document, expected);
}
else
{
iframe.onload = function()
{
if (ignoreTitle)
{
var title = iframe.contentWindow.document.getElementsByTagName("title")[0];
if (!title.innerHTML)
{
title.parentElement.removeChild(title);
}
}
process_result(input, iframe.contentWindow.document, expected, true);
}
iframe.src = "data:text/html," + encodeURIComponent(input);
break;
}
}
test();
}
function process_result(input, result, expected, async)
{
2010-07-27 Ojan Vafai <ojan@chromium.org> Reviewed by Adam Barth. dump-as-markup should have better output https://bugs.webkit.org/show_bug.cgi?id=43015 -Merge dom2string into dump-as-markup and pull over all dom2string features (e.g. indent). -#-prefix selection markers * editing/deleting/delete-br-in-last-table-cell-expected.txt: * editing/execCommand/crash-indenting-list-item-expected.txt: * editing/execCommand/crash-on-enter-in-contentEditable-list-expected.txt: * editing/execCommand/create-list-from-range-selection-expected.txt: * editing/execCommand/hilitecolor-expected.txt: * editing/execCommand/indent-pre-expected.txt: * editing/execCommand/insert-list-empty-div-expected.txt: * editing/selection/dump-as-markup-expected.txt: * editing/selection/dump-as-markup.html: * editing/selection/home-inside-noneditable-table-expected.txt: * editing/style/remove-underline-from-stylesheet-expected.txt: * editing/style/style-text-node-without-editable-parent-expected.txt: * editing/undo/redo-split-text-node-expected.txt: * editing/undo/redo-split-text-with-removal-expected.txt: * html5lib/resources/dom2string.js: Removed. * html5lib/resources/tests4.dat: * html5lib/resources/tests6.dat: * html5lib/runner-expected.txt: * html5lib/runner.html: * html5lib/webkit-resumer.html: * resources/dump-as-markup.js: (Markup.notifyDone): (Markup._get): (Markup._namespace): (Markup._dumpCalls.0.Markup._indent): (Markup._toAsciiLowerCase): (Markup._getMarkupForTextNode): (Markup._getSelectionMarker): Canonical link: https://commits.webkit.org/55126@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@64303 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-07-29 20:16:52 +00:00
result = Markup.get(result);
2010-05-26 Adam Barth <abarth@webkit.org> Reviewed by Eric Seidel. Make HTML5 lexer not ASSERT when resuming partial parses https://bugs.webkit.org/show_bug.cgi?id=39755 Add a test suite for partial parsing. This test runs all our parsing test cases, but stops and starts the parser at every character in the parse stream to make sure we resume parsing properly. Currently, a bunch of the test cases are commented out, but I'll comment them back in as I get them running. * html5lib/webkit-resumer-expected-html5.txt: Added. * html5lib/webkit-resumer-expected.txt: Added. * html5lib/webkit-resumer.html: Added. 2010-05-26 Adam Barth <abarth@webkit.org> Reviewed by Eric Seidel. Make HTML5 lexer not ASSERT when resuming partial parses https://bugs.webkit.org/show_bug.cgi?id=39755 I'm working through a variation of the webkit-runner.html test suite that stops the parser at every character to make sure we can resume parsing correctly. This patch fixes some errors caught by ASSERTs, which prevent the basic tests from running to completion. There's a bunch more work to do, however. Test: html5lib/webkit-resumer.html * html/HTML5Lexer.cpp: (WebCore::HTMLNames::isEndTagBufferingState): (WebCore::HTML5Lexer::nextToken): (WebCore::HTML5Lexer::addToPossibleEndTag): * html/HTML5Lexer.h: * html/HTML5Tokenizer.cpp: (WebCore::HTML5Tokenizer::write): * html/HTML5Tokenizer.h: 2010-05-26 Adam Barth <abarth@webkit.org> Reviewed by Eric Seidel. Make HTML5 lexer not ASSERT when resuming partial parses https://bugs.webkit.org/show_bug.cgi?id=39755 Add webkit-resumer.html to the HTML5 parser test suite. * Scripts/test-html5-parser: Canonical link: https://commits.webkit.org/51304@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@60253 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-05-26 21:51:01 +00:00
if (result !== expected)
{
fail_list.push(test_number + "." + subtest_number);
log += "\n\nTest " + (test_number) + " of " + (test_number + tests.length) + " in " + file + " failed. Input:\n" + input + "\nGot:\n" + result + "\nExpected:\n" + expected;
}
test_number++;
if (async)
test();
}
</script>