Diff
Modified: trunk/LayoutTests/ChangeLog (113264 => 113265)
--- trunk/LayoutTests/ChangeLog 2012-04-04 23:57:33 UTC (rev 113264)
+++ trunk/LayoutTests/ChangeLog 2012-04-05 00:00:31 UTC (rev 113265)
@@ -1,3 +1,19 @@
+2012-04-04 David Barr <[email protected]>
+
+ Unify and modernize fast/css/{outline,background}-currentcolor.html
+ https://bugs.webkit.org/show_bug.cgi?id=75523
+
+ Reviewed by Daniel Bates.
+
+ Use js-test-pre utility functions instead of hardcoded testing logic
+ to simplify the test code and make the test more closely conform to
+ the visual appearance of other PASS/FAIL tests.
+
+ * fast/css/background-currentcolor-expected.txt:
+ * fast/css/background-currentcolor.html:
+ * fast/css/outline-currentcolor-expected.txt:
+ * fast/css/outline-currentcolor.html:
+
2012-04-04 Tony Chang <[email protected]>
CSS transitions should work on the flex property
Modified: trunk/LayoutTests/fast/css/background-currentcolor-expected.txt (113264 => 113265)
--- trunk/LayoutTests/fast/css/background-currentcolor-expected.txt 2012-04-04 23:57:33 UTC (rev 113264)
+++ trunk/LayoutTests/fast/css/background-currentcolor-expected.txt 2012-04-05 00:00:31 UTC (rev 113265)
@@ -1 +1,12 @@
-PASSED
+Test that background-color is non-inherit and currentColor is handled correctly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS getComputedStyle(test1).backgroundColor is "rgb(0, 128, 0)"
+PASS getComputedStyle(test2).backgroundColor is "rgb(0, 128, 0)"
+PASS getComputedStyle(test3).backgroundColor is "rgb(0, 128, 0)"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Modified: trunk/LayoutTests/fast/css/background-currentcolor.html (113264 => 113265)
--- trunk/LayoutTests/fast/css/background-currentcolor.html 2012-04-04 23:57:33 UTC (rev 113264)
+++ trunk/LayoutTests/fast/css/background-currentcolor.html 2012-04-05 00:00:31 UTC (rev 113265)
@@ -1,40 +1,23 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html lang="en">
- <head>
- <title>currentColor basic test</title>
- <style type="text/css">
- div { height: 5em; width: 10em; }
- #three { color: blue; }
- </style>
- <script>
- function log(message) {
- var console = document.getElementById("console");
- console.appendChild(document.createTextNode(message + "\n"));
- }
- function runTest() {
- if (window.layoutTestController)
- layoutTestController.dumpAsText();
- var div = document.getElementById("two");
- div.style.color = "green";
- if (window.getComputedStyle(div).backgroundColor != "rgb(0, 128, 0)") {
- log("FAILED");
- return;
- }
- div = document.getElementById("three");
- if (window.getComputedStyle(div).color != "rgb(0, 128, 0)") {
- log("FAILED");
- return;
- }
- log("PASSED");
- }
- </script>
- </head>
- <body _onload_="runTest()">
- <div id="one" style="color:green; background: currentColor" ></div>
- <div id="two" style="color:red; background: currentColor" ></div>
+<!DOCTYPE html>
+<style>
+#test3 { color: blue; }
+</style>
+<div id="test-container">
+ <div id="test1" style="color:green; background: currentColor"></div>
+ <div id="test2" style="color:red; background: currentColor"></div>
<div style="color:green">
- <div id="three" style="color:currentColor; background: currentColor" ></div>
+ <div id="test3" style="color:currentColor; background: currentColor"></div>
</div>
- <div id="console"></div>
- </body>
-</html>
+</div>
+<script src=""
+<script>
+description('Test that background-color is non-inherit and currentColor is handled correctly.');
+var test1 = document.getElementById("test1");
+var test2 = document.getElementById("test2");
+var test3 = document.getElementById("test3");
+test2.style.color = "green";
+shouldBeEqualToString('getComputedStyle(test1).backgroundColor', 'rgb(0, 128, 0)');
+shouldBeEqualToString('getComputedStyle(test2).backgroundColor', 'rgb(0, 128, 0)');
+shouldBeEqualToString('getComputedStyle(test3).backgroundColor', 'rgb(0, 128, 0)');
+</script>
+<script src=""
Modified: trunk/LayoutTests/fast/css/outline-currentcolor-expected.txt (113264 => 113265)
--- trunk/LayoutTests/fast/css/outline-currentcolor-expected.txt 2012-04-04 23:57:33 UTC (rev 113264)
+++ trunk/LayoutTests/fast/css/outline-currentcolor-expected.txt 2012-04-05 00:00:31 UTC (rev 113265)
@@ -1,2 +1,12 @@
-Test that outline-color is non-inherit and currentColor is handled correctly. The test passes if 3 boxes with green outlines followed by the text "PASS" are displayed below.
-PASS
+Test that outline-color is non-inherit and currentColor is handled correctly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS getComputedStyle(test1).outlineColor is "rgb(0, 128, 0)"
+PASS getComputedStyle(test2).outlineColor is "rgb(0, 128, 0)"
+PASS getComputedStyle(test3).outlineColor is "rgb(0, 128, 0)"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Modified: trunk/LayoutTests/fast/css/outline-currentcolor.html (113264 => 113265)
--- trunk/LayoutTests/fast/css/outline-currentcolor.html 2012-04-04 23:57:33 UTC (rev 113264)
+++ trunk/LayoutTests/fast/css/outline-currentcolor.html 2012-04-05 00:00:31 UTC (rev 113265)
@@ -1,43 +1,23 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html lang="en">
- <head>
- <title>outlineColor not inherit and accepts currentColor</title>
- <style type="text/css">
- div { height: 3em; width: 25em; margin-bottom: 3em}
- body { margin: 2em; }
- #three { color: blue; }
- </style>
- <script>
- // FIXME: WK75523; re-write this and background-currentcolor.html to use js-test-pre.js
- function log(message) {
- var console = document.getElementById("console");
- console.appendChild(document.createTextNode(message + "\n"));
- }
- function runTest(property) {
- if (window.layoutTestController)
- layoutTestController.dumpAsText();
- var div = document.getElementById("two");
- div.style.color = "green";
- if (window.getComputedStyle(div)[property] != "rgb(0, 128, 0)") {
- log("FAIL");
- return;
- }
- div = document.getElementById("three");
- if (window.getComputedStyle(div).color != "rgb(0, 128, 0)") {
- log("FAIL");
- return;
- }
- log("PASS");
- }
- </script>
- </head>
- <body _onload_="runTest('outlineColor')">
- <div>Test that outline-color is non-inherit and currentColor is handled correctly. The test passes if 3 boxes with green outlines followed by the text "PASS" are displayed below.</div>
- <div id="one" style="color:green; outline: solid 1em currentColor" ></div>
- <div id="two" style="color:red; outline: solid 1em currentColor" ></div>
+<!DOCTYPE html>
+<style>
+#test3 { color: blue; }
+</style>
+<div id="test-container">
+ <div id="test1" id="one" style="color:green; outline: solid 1em currentColor"></div>
+ <div id="test2" id="two" style="color:red; outline: solid 1em currentColor"></div>
<div style="color:green">
- <div id="three" style="color:currentColor; outline: solid 1em currentColor" ></div>
+ <div id="test3" style="color:currentColor; outline: solid 1em currentColor"></div>
</div>
- <div id="console"></div>
- </body>
-</html>
+</div>
+<script src=""
+<script>
+description('Test that outline-color is non-inherit and currentColor is handled correctly.');
+var test1 = document.getElementById("test1");
+var test2 = document.getElementById("test2");
+var test3 = document.getElementById("test3");
+test2.style.color = "green";
+shouldBeEqualToString('getComputedStyle(test1).outlineColor', 'rgb(0, 128, 0)');
+shouldBeEqualToString('getComputedStyle(test2).outlineColor', 'rgb(0, 128, 0)');
+shouldBeEqualToString('getComputedStyle(test3).outlineColor', 'rgb(0, 128, 0)');
+</script>
+<script src=""