Backed out changeset 5607b8b76949
authorShawn Wilsher <sdwilsh@shawnwilsher.com>
Thu, 18 Feb 2010 09:44:28 -0800
changeset 38217 fec999d5f66684f208eae549a0cb307d0cad8676
parent 38195 5607b8b76949e4a1c84cbc766367cbd9e0fdbedc
child 38218 e0e7b65bc4155da237dac3e8fc8d58eec079782e
push id11664
push usersdwilsh@shawnwilsher.com
push dateThu, 18 Feb 2010 18:30:33 +0000
treeherdermozilla-central@bfe41dab22a5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone1.9.3a2pre
backs out5607b8b76949e4a1c84cbc766367cbd9e0fdbedc
Backed out changeset 5607b8b76949
dom/tests/mochitest/whatwg/file_bug500328_1.html
dom/tests/mochitest/whatwg/test_bug500328.html
--- a/dom/tests/mochitest/whatwg/file_bug500328_1.html
+++ b/dom/tests/mochitest/whatwg/file_bug500328_1.html
@@ -1,20 +1,16 @@
 <!DOCTYPE HTML>
 <html>
 <!--
 Inner frame for testing bug 500328.
 https://bugzilla.mozilla.org/show_bug.cgi?id=500328
 -->
 <head>
 <title>test 1</title>
-  <style>
-    a           { fill:blue; }
-    a:visited   { fill:purple; }
-  </style>
 </head>
 <body onload="load();" onpopstate="popstate(event);">
 <script type="application/javascript">
   function load() {
     if(parent && parent.onChildLoad)
       parent.onChildLoad();
     if(opener && opener.onChildLoad)
       opener.onChildLoad();
--- a/dom/tests/mochitest/whatwg/test_bug500328.html
+++ b/dom/tests/mochitest/whatwg/test_bug500328.html
@@ -27,18 +27,18 @@ https://bugzilla.mozilla.org/show_bug.cg
 SimpleTest.waitForExplicitFinish();
 
 var iframe = document.getElementById("iframe");
 var iframeCw = iframe.contentWindow;
 
 var iframe2 = document.getElementById("iframe2");
 var iframe2Cw = iframe2.contentWindow;
 
-const unvisitedColor = "rgb(0, 0, 238)";
-const visitedColor = "rgb(85, 26, 139)";
+var unvisitedColor;
+var visitedColor;
 
 var gCallbackOnIframeLoad = false;
 var gCallbackOnPopState = false;
 var gNumPopStates = 0;
 var gLastPopStateEvent;
 
 var gGen;
 
@@ -171,20 +171,35 @@ function expectException(func, msg) {
 function runTest() {
   // We can't enable universal XPConnect privleges in this function, because
   // test 5 needs to be running at normal privleges in order to test the
   // same-origin policy.
 
   /**
    * PRELIMINARY:
    *  1. Clear the popstate counter
+   *  2. Get the visited and unvisited link colors.
    */
 
   clearPopStateCounter();
 
+  // Set the link's href to somewhere we haven't been so we can get the
+  // unvisited link color.
+  var rand = Date.now() + "-" + Math.random();
+  $("link").href = rand;
+  unvisitedColor = getColor($("link"));
+  statusMsg("Unvisited color is " + unvisitedColor);
+
+  // Set the link's href to our current location so we can get the visited link
+  // color.
+  $("link").href = document.location;
+  visitedColor = getColor($("link"));
+  statusMsg("Visited color is " + visitedColor);
+  isnot(visitedColor, unvisitedColor, "visited/unvisited link colors are the same?");
+
   // The URL of file_bug500328_1.html on http://localhost:8888
   var innerLoc;
 
   // Now we can start the tests
 
   /**
    * TEST 1 tests basic pushState functionality
    */
@@ -283,17 +298,16 @@ function runTest() {
   iframe.onload = null;
   iframeCw.location = "file_bug500328_1.html";
   enableChildPopStateCallback();
   yield;
   popstateExpected("No popstate after re-loading file_bug500328_1.html");
   statusMsg("Done loading file_bug500328_1.html for the second time.");
 
   var ifLink = iframeCw.document.getElementById("link-anchor1");
-  var rand = Date.now() + "-" + Math.random();
   ifLink.href = rand;
 
   // Poll the document until the link has the correct color, or this test times
   // out.  Unfortunately I can't come up with a more elegant way to do this.
   // We could listen to MozAfterPaint, but that doesn't guarantee that we'll
   // observe the new color.
   while (getColor(ifLink) != unvisitedColor) {
     // Dump so something shows up in the mochitest logs if we spin here.