Modernize the test visited-link-background-color.html
authorbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Mar 2013 21:48:19 +0000 (21:48 +0000)
committerbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Mar 2013 21:48:19 +0000 (21:48 +0000)
https://bugs.webkit.org/show_bug.cgi?id=111931

Reviewed by Sam Weinig.

Make the test a ref-test instead of a pixel test.

Use Internals' computedStyleIncludingVisitedInfo to make the test reliable
on platforms where the visited link list is updated asynchronously.

* fast/history/visited-link-background-color-expected.html: Copied from LayoutTests/fast/history/visited-link-background-color.html.
* fast/history/visited-link-background-color.html:
* platform/chromium-linux/fast/history/visited-link-background-color-expected.png: Removed.
* platform/chromium-win/fast/history/visited-link-background-color-expected.png: Removed.
* platform/chromium/TestExpectations:
* platform/chromium/fast/history/visited-link-background-color-expected.png: Removed.
* platform/chromium/fast/history/visited-link-background-color-expected.txt: Removed.
* platform/efl-wk1/fast/history/visited-link-background-color-expected.png: Removed.
* platform/efl/fast/history/visited-link-background-color-expected.png: Removed.
* platform/efl/fast/history/visited-link-background-color-expected.txt: Removed.
* platform/gtk/fast/history/visited-link-background-color-expected.png: Removed.
* platform/gtk/fast/history/visited-link-background-color-expected.txt: Removed.
* platform/mac-wk2/fast/history/visited-link-background-color-expected.png: Removed.
* platform/mac-wk2/fast/history/visited-link-background-color-expected.txt: Removed.
* platform/mac/fast/history/visited-link-background-color-expected.png: Removed.
* platform/mac/fast/history/visited-link-background-color-expected.txt: Removed.
* platform/qt/fast/history/visited-link-background-color-expected.png: Removed.
* platform/qt/fast/history/visited-link-background-color-expected.txt: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@145408 268f45cc-cd09-0410-ab3c-d52691b4dbfc

19 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/history/visited-link-background-color-expected.html [new file with mode: 0644]
LayoutTests/fast/history/visited-link-background-color.html
LayoutTests/platform/chromium-linux/fast/history/visited-link-background-color-expected.png [deleted file]
LayoutTests/platform/chromium-win/fast/history/visited-link-background-color-expected.png [deleted file]
LayoutTests/platform/chromium/TestExpectations
LayoutTests/platform/chromium/fast/history/visited-link-background-color-expected.png [deleted file]
LayoutTests/platform/chromium/fast/history/visited-link-background-color-expected.txt [deleted file]
LayoutTests/platform/efl-wk1/fast/history/visited-link-background-color-expected.png [deleted file]
LayoutTests/platform/efl/fast/history/visited-link-background-color-expected.png [deleted file]
LayoutTests/platform/efl/fast/history/visited-link-background-color-expected.txt [deleted file]
LayoutTests/platform/gtk/fast/history/visited-link-background-color-expected.png [deleted file]
LayoutTests/platform/gtk/fast/history/visited-link-background-color-expected.txt [deleted file]
LayoutTests/platform/mac-wk2/fast/history/visited-link-background-color-expected.png [deleted file]
LayoutTests/platform/mac-wk2/fast/history/visited-link-background-color-expected.txt [deleted file]
LayoutTests/platform/mac/fast/history/visited-link-background-color-expected.png [deleted file]
LayoutTests/platform/mac/fast/history/visited-link-background-color-expected.txt [deleted file]
LayoutTests/platform/qt/fast/history/visited-link-background-color-expected.png [deleted file]
LayoutTests/platform/qt/fast/history/visited-link-background-color-expected.txt [deleted file]

index 2c74678..669c9ba 100644 (file)
@@ -1,3 +1,34 @@
+2013-03-11  Benjamin Poulain  <benjamin@webkit.org>
+
+        Modernize the test visited-link-background-color.html
+        https://bugs.webkit.org/show_bug.cgi?id=111931
+
+        Reviewed by Sam Weinig.
+
+        Make the test a ref-test instead of a pixel test.
+
+        Use Internals' computedStyleIncludingVisitedInfo to make the test reliable
+        on platforms where the visited link list is updated asynchronously.
+
+        * fast/history/visited-link-background-color-expected.html: Copied from LayoutTests/fast/history/visited-link-background-color.html.
+        * fast/history/visited-link-background-color.html:
+        * platform/chromium-linux/fast/history/visited-link-background-color-expected.png: Removed.
+        * platform/chromium-win/fast/history/visited-link-background-color-expected.png: Removed.
+        * platform/chromium/TestExpectations:
+        * platform/chromium/fast/history/visited-link-background-color-expected.png: Removed.
+        * platform/chromium/fast/history/visited-link-background-color-expected.txt: Removed.
+        * platform/efl-wk1/fast/history/visited-link-background-color-expected.png: Removed.
+        * platform/efl/fast/history/visited-link-background-color-expected.png: Removed.
+        * platform/efl/fast/history/visited-link-background-color-expected.txt: Removed.
+        * platform/gtk/fast/history/visited-link-background-color-expected.png: Removed.
+        * platform/gtk/fast/history/visited-link-background-color-expected.txt: Removed.
+        * platform/mac-wk2/fast/history/visited-link-background-color-expected.png: Removed.
+        * platform/mac-wk2/fast/history/visited-link-background-color-expected.txt: Removed.
+        * platform/mac/fast/history/visited-link-background-color-expected.png: Removed.
+        * platform/mac/fast/history/visited-link-background-color-expected.txt: Removed.
+        * platform/qt/fast/history/visited-link-background-color-expected.png: Removed.
+        * platform/qt/fast/history/visited-link-background-color-expected.txt: Removed.
+
 2013-03-11  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r144818.
diff --git a/LayoutTests/fast/history/visited-link-background-color-expected.html b/LayoutTests/fast/history/visited-link-background-color-expected.html
new file mode 100644 (file)
index 0000000..f12d2c3
--- /dev/null
@@ -0,0 +1,15 @@
+<style>
+a {
+  display:block;
+  width:500px;
+  height:500px;
+  color:white;
+}
+a:link {
+  background:olive;
+}
+</style>
+<body>
+<iframe src="resources/dummy.html" style="display:none"></iframe>
+<a href="resources/dummy.html">This text should be white on an olive background.</a>
+</body>
index 449e709..3039897 100644 (file)
@@ -9,9 +9,27 @@ a:visited {
 }
 </style>
 <script>
-if (window.testRunner)
-    window.testRunner.keepWebHistory();
+if (window.testRunner) {
+    testRunner.waitUntilDone();
+    testRunner.keepWebHistory();
+}
+function waitForStyleChange(failureTime)
+{
+    var aElement = document.getElementsByTagName('a')[0];
+    if (internals.computedStyleIncludingVisitedInfo(aElement).color === 'rgb(255, 255, 255)')
+        testRunner.notifyDone();
+    else if (Date.now() > failureTime)
+        testRunner.notifyDone();
+    else
+        setTimeout(waitForStyleChange, 5, failureTime);
+}
+function doTest()
+{
+    if (window.testRunner)
+        waitForStyleChange(Date.now() + 500);
+}
 </script>
-<body>
+<body onload="doTest()">
 <iframe src="resources/dummy.html" style="display:none"></iframe>
 <a href="resources/dummy.html">This text should be white on an olive background.</a>
+</body>
diff --git a/LayoutTests/platform/chromium-linux/fast/history/visited-link-background-color-expected.png b/LayoutTests/platform/chromium-linux/fast/history/visited-link-background-color-expected.png
deleted file mode 100644 (file)
index 0bc1d05..0000000
Binary files a/LayoutTests/platform/chromium-linux/fast/history/visited-link-background-color-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/chromium-win/fast/history/visited-link-background-color-expected.png b/LayoutTests/platform/chromium-win/fast/history/visited-link-background-color-expected.png
deleted file mode 100644 (file)
index 81091df..0000000
Binary files a/LayoutTests/platform/chromium-win/fast/history/visited-link-background-color-expected.png and /dev/null differ
index 6ea9710..816080c 100644 (file)
@@ -2194,7 +2194,7 @@ webkit.org/b/111031 fast/history/nested-visited-test.html [ Failure ]
 webkit.org/b/111031 fast/history/self-is-visited.html [ Failure ]
 webkit.org/b/111031 fast/history/sibling-visited-test.html [ Failure ]
 webkit.org/b/111031 fast/loader/stateobjects/state-url-sets-links-visited.html [ Failure ]
-webkit.org/b/111031 [ Mac Android ] fast/history/visited-link-background-color.html [ Failure ]
+webkit.org/b/111031 fast/history/visited-link-background-color.html [ ImageOnlyFailure ]
 
 # Tests that work with KURL, but fail with GURL
 webkit.org/b/71758 fast/url/invalid-urls-utf8.html [ Failure ]
diff --git a/LayoutTests/platform/chromium/fast/history/visited-link-background-color-expected.png b/LayoutTests/platform/chromium/fast/history/visited-link-background-color-expected.png
deleted file mode 100644 (file)
index 0bc1d05..0000000
Binary files a/LayoutTests/platform/chromium/fast/history/visited-link-background-color-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/chromium/fast/history/visited-link-background-color-expected.txt b/LayoutTests/platform/chromium/fast/history/visited-link-background-color-expected.txt
deleted file mode 100644 (file)
index 050daf8..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-      RenderBlock {A} at (0,0) size 500x500 [color=#0000EE] [bgcolor=#808000]
-        RenderText {#text} at (0,0) size 298x19
-          text run at (0,0) width 298: "This text should be white on an olive background."
diff --git a/LayoutTests/platform/efl-wk1/fast/history/visited-link-background-color-expected.png b/LayoutTests/platform/efl-wk1/fast/history/visited-link-background-color-expected.png
deleted file mode 100644 (file)
index f81aeec..0000000
Binary files a/LayoutTests/platform/efl-wk1/fast/history/visited-link-background-color-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/efl/fast/history/visited-link-background-color-expected.png b/LayoutTests/platform/efl/fast/history/visited-link-background-color-expected.png
deleted file mode 100644 (file)
index dd6e78b..0000000
Binary files a/LayoutTests/platform/efl/fast/history/visited-link-background-color-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/efl/fast/history/visited-link-background-color-expected.txt b/LayoutTests/platform/efl/fast/history/visited-link-background-color-expected.txt
deleted file mode 100644 (file)
index a8b01a5..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-      RenderBlock {A} at (0,0) size 500x500 [color=#FFFFFF] [bgcolor=#808000]
-        RenderText {#text} at (0,0) size 316x19
-          text run at (0,0) width 316: "This text should be white on an olive background."
diff --git a/LayoutTests/platform/gtk/fast/history/visited-link-background-color-expected.png b/LayoutTests/platform/gtk/fast/history/visited-link-background-color-expected.png
deleted file mode 100644 (file)
index 9fdca23..0000000
Binary files a/LayoutTests/platform/gtk/fast/history/visited-link-background-color-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/gtk/fast/history/visited-link-background-color-expected.txt b/LayoutTests/platform/gtk/fast/history/visited-link-background-color-expected.txt
deleted file mode 100644 (file)
index a8b01a5..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-      RenderBlock {A} at (0,0) size 500x500 [color=#FFFFFF] [bgcolor=#808000]
-        RenderText {#text} at (0,0) size 316x19
-          text run at (0,0) width 316: "This text should be white on an olive background."
diff --git a/LayoutTests/platform/mac-wk2/fast/history/visited-link-background-color-expected.png b/LayoutTests/platform/mac-wk2/fast/history/visited-link-background-color-expected.png
deleted file mode 100644 (file)
index 98104c0..0000000
Binary files a/LayoutTests/platform/mac-wk2/fast/history/visited-link-background-color-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/mac-wk2/fast/history/visited-link-background-color-expected.txt b/LayoutTests/platform/mac-wk2/fast/history/visited-link-background-color-expected.txt
deleted file mode 100644 (file)
index 0275ed2..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-      RenderBlock {A} at (0,0) size 500x500 [color=#0000EE] [bgcolor=#808000]
-        RenderText {#text} at (0,0) size 316x18
-          text run at (0,0) width 316: "This text should be white on an olive background."
diff --git a/LayoutTests/platform/mac/fast/history/visited-link-background-color-expected.png b/LayoutTests/platform/mac/fast/history/visited-link-background-color-expected.png
deleted file mode 100644 (file)
index b316c52..0000000
Binary files a/LayoutTests/platform/mac/fast/history/visited-link-background-color-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/mac/fast/history/visited-link-background-color-expected.txt b/LayoutTests/platform/mac/fast/history/visited-link-background-color-expected.txt
deleted file mode 100644 (file)
index 73a1167..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-      RenderBlock {A} at (0,0) size 500x500 [color=#FFFFFF] [bgcolor=#808000]
-        RenderText {#text} at (0,0) size 316x18
-          text run at (0,0) width 316: "This text should be white on an olive background."
diff --git a/LayoutTests/platform/qt/fast/history/visited-link-background-color-expected.png b/LayoutTests/platform/qt/fast/history/visited-link-background-color-expected.png
deleted file mode 100644 (file)
index 9719ce0..0000000
Binary files a/LayoutTests/platform/qt/fast/history/visited-link-background-color-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/qt/fast/history/visited-link-background-color-expected.txt b/LayoutTests/platform/qt/fast/history/visited-link-background-color-expected.txt
deleted file mode 100644 (file)
index 55fef75..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-      RenderBlock {A} at (0,0) size 500x500 [color=#FFFFFF] [bgcolor=#808000]
-        RenderText {#text} at (0,0) size 298x19
-          text run at (0,0) width 298: "This text should be white on an olive background."