Skip to content
Permalink
Browse files
De-flake fast/dom/title-directionality.html
https://bugs.webkit.org/show_bug.cgi?id=112075

Reviewed by Adam Barth.

This moves the test logic from an inline script to an onload handler. Otherwise, the whitespace collapsing logic
creates a race between the style recalc timer and the HTML parser which sometimes produces an extra newline at
the end of the text output.

* fast/dom/title-directionality-expected.txt:
* fast/dom/title-directionality.html:

Canonical link: https://commits.webkit.org/130381@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@145429 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
jamesr committed Mar 11, 2013
1 parent 1170d47 commit fa39ceef63da21078cb7c7e04cfd5ab85ecadc81
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 31 deletions.
@@ -1,3 +1,17 @@
2013-03-11 James Robinson <jamesr@chromium.org>

De-flake fast/dom/title-directionality.html
https://bugs.webkit.org/show_bug.cgi?id=112075

Reviewed by Adam Barth.

This moves the test logic from an inline script to an onload handler. Otherwise, the whitespace collapsing logic
creates a race between the style recalc timer and the HTML parser which sometimes produces an extra newline at
the end of the text output.

* fast/dom/title-directionality-expected.txt:
* fast/dom/title-directionality.html:

2013-03-05 Ojan Vafai <ojan@chromium.org>

Intrinsic width keyword values don't work for tables
@@ -3,4 +3,3 @@
<html><title dir=rtl>foo</title></html> should have title direction "rtl". PASS
<html dir=rtl><title>foo</title></html> should have title direction "rtl". PASS
<html dir=rtl><title dir=ltr>foo</title></html> should have title direction "ltr". PASS

@@ -3,43 +3,45 @@
<head>
<title>page title</title>
</head>
<body>
<body onload="runTest()">
<iframe id=iframe></iframe>
<script>
var iframe = document.getElementById('iframe');
function runTest() {
var iframe = document.getElementById('iframe');

function assertDirection(label, expectedDirection, html)
{
var doc = iframe.contentDocument;
doc.open();
doc.write(html);
doc.close();
function assertDirection(label, expectedDirection, html)
{
var doc = iframe.contentDocument;
doc.open();
doc.write(html);
doc.close();

var dir = window.testRunner ?
testRunner.titleTextDirection
: 'testRunner unavailable';
var status = html + ' should have title direction "' + expectedDirection + '". ';
if (dir == expectedDirection) {
status += 'PASS';
} else {
status += 'FAIL (got: "' + dir + '")';
var dir = window.testRunner ?
testRunner.titleTextDirection
: 'testRunner unavailable';
var status = html + ' should have title direction "' + expectedDirection + '". ';
if (dir == expectedDirection) {
status += 'PASS';
} else {
status += 'FAIL (got: "' + dir + '")';
}
var div = document.createElement('div');
div.innerText = status;
document.body.appendChild(div);
}
var div = document.createElement('div');
div.innerText = status;
document.body.appendChild(div);
}

if (window.testRunner)
testRunner.dumpAsText();
if (window.testRunner)
testRunner.dumpAsText();

assertDirection('normal doc', 'ltr',
'<html><title>foo</title></html>');
assertDirection('title dir=rtl', 'rtl',
'<html><title dir=rtl>foo</title></html>');
assertDirection('html dir=rtl', 'rtl',
'<html dir=rtl><title>foo</title></html>');
assertDirection('html dir=rtl, title dir=ltr', 'ltr',
'<html dir=rtl><title dir=ltr>foo</title></html>');
assertDirection('normal doc', 'ltr',
'<html><title>foo</title></html>');
assertDirection('title dir=rtl', 'rtl',
'<html><title dir=rtl>foo</title></html>');
assertDirection('html dir=rtl', 'rtl',
'<html dir=rtl><title>foo</title></html>');
assertDirection('html dir=rtl, title dir=ltr', 'ltr',
'<html dir=rtl><title dir=ltr>foo</title></html>');
}
</script>
</body>
</html>

0 comments on commit fa39cee

Please sign in to comment.