Diagnostic instrumentation for bug 536603.
authorZack Weinberg <zackw@panix.com>
Sun, 23 Sep 2012 11:18:10 -0400
changeset 107840 db922dc3669e668db398ccf727635988e8ad0dc5
parent 107839 ec54f1bf1c83ead2cb15f2273c2da837c83a319c
child 107846 95f1163d4fe35a603634647046da9ff2500135ef
push id23512
push userzackw@panix.com
push dateSun, 23 Sep 2012 15:21:46 +0000
treeherdermozilla-central@db922dc3669e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs536603
milestone18.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Diagnostic instrumentation for bug 536603.
layout/style/test/ccd-quirks.html
layout/style/test/ccd-standards.html
layout/style/test/test_css_cross_domain.html
--- a/layout/style/test/ccd-quirks.html
+++ b/layout/style/test/ccd-quirks.html
@@ -56,41 +56,55 @@ p + p { left: 22px }
 @import url("redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?JC2iq");
 @import url("redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?JC3iq");
 @import url("http://example.org/tests/layout/style/test/redirect.sjs?http://mochi.test:8888/tests/layout/style/test/ccd.sjs?JD1iq");
 @import url("http://example.org/tests/layout/style/test/redirect.sjs?http://mochi.test:8888/tests/layout/style/test/ccd.sjs?JD2iq");
 @import url("http://example.org/tests/layout/style/test/redirect.sjs?http://mochi.test:8888/tests/layout/style/test/ccd.sjs?JD3iq");
 </style>
 
 <!-- link directives -->
-<link rel="stylesheet" href="ccd.sjs?IA1lq">
-<link rel="stylesheet" href="ccd.sjs?IA2lq">
-<link rel="stylesheet" href="ccd.sjs?IA3lq">
-<link rel="stylesheet" href="http://example.org/tests/layout/style/test/ccd.sjs?IB1lq">
-<link rel="stylesheet" href="http://example.org/tests/layout/style/test/ccd.sjs?IB2lq">
-<link rel="stylesheet" href="http://example.org/tests/layout/style/test/ccd.sjs?IB3lq">
-<link rel="stylesheet" href="redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?IC1lq">
-<link rel="stylesheet" href="redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?IC2lq">
-<link rel="stylesheet" href="redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?IC3lq">
-<link rel="stylesheet" href="http://example.org/tests/layout/style/test/redirect.sjs?ccd.sjs?ID1lq">
-<link rel="stylesheet" href="http://example.org/tests/layout/style/test/redirect.sjs?ccd.sjs?ID2lq">
-<link rel="stylesheet" href="http://example.org/tests/layout/style/test/redirect.sjs?ccd.sjs?ID3lq">
-<link rel="stylesheet" href="ccd.sjs?JA1lq">
-<link rel="stylesheet" href="ccd.sjs?JA2lq">
-<link rel="stylesheet" href="ccd.sjs?JA3lq">
-<link rel="stylesheet" href="http://example.org/tests/layout/style/test/ccd.sjs?JB1lq">
-<link rel="stylesheet" href="http://example.org/tests/layout/style/test/ccd.sjs?JB2lq">
-<link rel="stylesheet" href="http://example.org/tests/layout/style/test/ccd.sjs?JB3lq">
-<link rel="stylesheet" href="redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?JC1lq">
-<link rel="stylesheet" href="redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?JC2lq">
-<link rel="stylesheet" href="redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?JC3lq">
-<link rel="stylesheet" href="http://example.org/tests/layout/style/test/redirect.sjs?http://mochi.test:8888/tests/layout/style/test/ccd.sjs?JD1lq">
-<link rel="stylesheet" href="http://example.org/tests/layout/style/test/redirect.sjs?http://mochi.test:8888/tests/layout/style/test/ccd.sjs?JD2lq">
-<link rel="stylesheet" href="http://example.org/tests/layout/style/test/redirect.sjs?http://mochi.test:8888/tests/layout/style/test/ccd.sjs?JD3lq">
+<link rel="stylesheet" data-href="ccd.sjs?IA1lq">
+<link rel="stylesheet" data-href="ccd.sjs?IA2lq">
+<link rel="stylesheet" data-href="ccd.sjs?IA3lq">
+<link rel="stylesheet" data-href="http://example.org/tests/layout/style/test/ccd.sjs?IB1lq">
+<link rel="stylesheet" data-href="http://example.org/tests/layout/style/test/ccd.sjs?IB2lq">
+<link rel="stylesheet" data-href="http://example.org/tests/layout/style/test/ccd.sjs?IB3lq">
+<link rel="stylesheet" data-href="redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?IC1lq">
+<link rel="stylesheet" data-href="redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?IC2lq">
+<link rel="stylesheet" data-href="redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?IC3lq">
+<link rel="stylesheet" data-href="http://example.org/tests/layout/style/test/redirect.sjs?ccd.sjs?ID1lq">
+<link rel="stylesheet" data-href="http://example.org/tests/layout/style/test/redirect.sjs?ccd.sjs?ID2lq">
+<link rel="stylesheet" data-href="http://example.org/tests/layout/style/test/redirect.sjs?ccd.sjs?ID3lq">
+<link rel="stylesheet" data-href="ccd.sjs?JA1lq">
+<link rel="stylesheet" data-href="ccd.sjs?JA2lq">
+<link rel="stylesheet" data-href="ccd.sjs?JA3lq">
+<link rel="stylesheet" data-href="http://example.org/tests/layout/style/test/ccd.sjs?JB1lq">
+<link rel="stylesheet" data-href="http://example.org/tests/layout/style/test/ccd.sjs?JB2lq">
+<link rel="stylesheet" data-href="http://example.org/tests/layout/style/test/ccd.sjs?JB3lq">
+<link rel="stylesheet" data-href="redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?JC1lq">
+<link rel="stylesheet" data-href="redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?JC2lq">
+<link rel="stylesheet" data-href="redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?JC3lq">
+<link rel="stylesheet" data-href="http://example.org/tests/layout/style/test/redirect.sjs?http://mochi.test:8888/tests/layout/style/test/ccd.sjs?JD1lq">
+<link rel="stylesheet" data-href="http://example.org/tests/layout/style/test/redirect.sjs?http://mochi.test:8888/tests/layout/style/test/ccd.sjs?JD2lq">
+<link rel="stylesheet" data-href="http://example.org/tests/layout/style/test/redirect.sjs?http://mochi.test:8888/tests/layout/style/test/ccd.sjs?JD3lq">
+<script>
+// attach onload and onerror handlers to every link tag, then activate
+// them.  see audit logic in test_css_cross_domain.html
+function setCompleted() {
+  this.dataset.completed = true;
+}
 
+var links = document.getElementsByTagName("link");
+for (var i = 0; i < links.length; i++) {
+  links[i].dataset.completed = false;
+  links[i].addEventListener("load", setCompleted);
+  links[i].addEventListener("error", setCompleted);
+  links[i].href = links[i].dataset.href;
+}
+</script>
 </head><body>
 <div></div>
 <div></div>
 <div><p id="IA1i"></p><p id="IA1l"></p></div>
 <div><p id="IA2i"></p><p id="IA2l"></p></div>
 <div><p id="IA3i"></p><p id="IA3l"></p></div>
 <div></div>
 <div><p id="IB1i"></p><p id="IB1l"></p></div>
@@ -116,9 +130,10 @@ p + p { left: 22px }
 <div></div>
 <div><p id="JC1i"></p><p id="JC1l"></p></div>
 <div><p id="JC2i"></p><p id="JC2l"></p></div>
 <div><p id="JC3i"></p><p id="JC3l"></p></div>
 <div></div>
 <div><p id="JD1i"></p><p id="JD1l"></p></div>
 <div><p id="JD2i"></p><p id="JD2l"></p></div>
 <div><p id="JD3i"></p><p id="JD3l"></p></div>
+
 </body></html>
--- a/layout/style/test/ccd-standards.html
+++ b/layout/style/test/ccd-standards.html
@@ -55,41 +55,55 @@ p + p { left: 22px }
 @import url("redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?JC2is");
 @import url("redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?JC3is");
 @import url("http://example.org/tests/layout/style/test/redirect.sjs?http://mochi.test:8888/tests/layout/style/test/ccd.sjs?JD1is");
 @import url("http://example.org/tests/layout/style/test/redirect.sjs?http://mochi.test:8888/tests/layout/style/test/ccd.sjs?JD2is");
 @import url("http://example.org/tests/layout/style/test/redirect.sjs?http://mochi.test:8888/tests/layout/style/test/ccd.sjs?JD3is");
 </style>
 
 <!-- link directives -->
-<link rel="stylesheet" href="ccd.sjs?IA1ls">
-<link rel="stylesheet" href="ccd.sjs?IA2ls">
-<link rel="stylesheet" href="ccd.sjs?IA3ls">
-<link rel="stylesheet" href="http://example.org/tests/layout/style/test/ccd.sjs?IB1ls">
-<link rel="stylesheet" href="http://example.org/tests/layout/style/test/ccd.sjs?IB2ls">
-<link rel="stylesheet" href="http://example.org/tests/layout/style/test/ccd.sjs?IB3ls">
-<link rel="stylesheet" href="redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?IC1ls">
-<link rel="stylesheet" href="redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?IC2ls">
-<link rel="stylesheet" href="redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?IC3ls">
-<link rel="stylesheet" href="http://example.org/tests/layout/style/test/redirect.sjs?ccd.sjs?ID1ls">
-<link rel="stylesheet" href="http://example.org/tests/layout/style/test/redirect.sjs?ccd.sjs?ID2ls">
-<link rel="stylesheet" href="http://example.org/tests/layout/style/test/redirect.sjs?ccd.sjs?ID3ls">
-<link rel="stylesheet" href="ccd.sjs?JA1ls">
-<link rel="stylesheet" href="ccd.sjs?JA2ls">
-<link rel="stylesheet" href="ccd.sjs?JA3ls">
-<link rel="stylesheet" href="http://example.org/tests/layout/style/test/ccd.sjs?JB1ls">
-<link rel="stylesheet" href="http://example.org/tests/layout/style/test/ccd.sjs?JB2ls">
-<link rel="stylesheet" href="http://example.org/tests/layout/style/test/ccd.sjs?JB3ls">
-<link rel="stylesheet" href="redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?JC1ls">
-<link rel="stylesheet" href="redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?JC2ls">
-<link rel="stylesheet" href="redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?JC3ls">
-<link rel="stylesheet" href="http://example.org/tests/layout/style/test/redirect.sjs?http://mochi.test:8888/tests/layout/style/test/ccd.sjs?JD1ls">
-<link rel="stylesheet" href="http://example.org/tests/layout/style/test/redirect.sjs?http://mochi.test:8888/tests/layout/style/test/ccd.sjs?JD2ls">
-<link rel="stylesheet" href="http://example.org/tests/layout/style/test/redirect.sjs?http://mochi.test:8888/tests/layout/style/test/ccd.sjs?JD3ls">
+<link rel="stylesheet" data-href="ccd.sjs?IA1ls">
+<link rel="stylesheet" data-href="ccd.sjs?IA2ls">
+<link rel="stylesheet" data-href="ccd.sjs?IA3ls">
+<link rel="stylesheet" data-href="http://example.org/tests/layout/style/test/ccd.sjs?IB1ls">
+<link rel="stylesheet" data-href="http://example.org/tests/layout/style/test/ccd.sjs?IB2ls">
+<link rel="stylesheet" data-href="http://example.org/tests/layout/style/test/ccd.sjs?IB3ls">
+<link rel="stylesheet" data-href="redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?IC1ls">
+<link rel="stylesheet" data-href="redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?IC2ls">
+<link rel="stylesheet" data-href="redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?IC3ls">
+<link rel="stylesheet" data-href="http://example.org/tests/layout/style/test/redirect.sjs?ccd.sjs?ID1ls">
+<link rel="stylesheet" data-href="http://example.org/tests/layout/style/test/redirect.sjs?ccd.sjs?ID2ls">
+<link rel="stylesheet" data-href="http://example.org/tests/layout/style/test/redirect.sjs?ccd.sjs?ID3ls">
+<link rel="stylesheet" data-href="ccd.sjs?JA1ls">
+<link rel="stylesheet" data-href="ccd.sjs?JA2ls">
+<link rel="stylesheet" data-href="ccd.sjs?JA3ls">
+<link rel="stylesheet" data-href="http://example.org/tests/layout/style/test/ccd.sjs?JB1ls">
+<link rel="stylesheet" data-href="http://example.org/tests/layout/style/test/ccd.sjs?JB2ls">
+<link rel="stylesheet" data-href="http://example.org/tests/layout/style/test/ccd.sjs?JB3ls">
+<link rel="stylesheet" data-href="redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?JC1ls">
+<link rel="stylesheet" data-href="redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?JC2ls">
+<link rel="stylesheet" data-href="redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?JC3ls">
+<link rel="stylesheet" data-href="http://example.org/tests/layout/style/test/redirect.sjs?http://mochi.test:8888/tests/layout/style/test/ccd.sjs?JD1ls">
+<link rel="stylesheet" data-href="http://example.org/tests/layout/style/test/redirect.sjs?http://mochi.test:8888/tests/layout/style/test/ccd.sjs?JD2ls">
+<link rel="stylesheet" data-href="http://example.org/tests/layout/style/test/redirect.sjs?http://mochi.test:8888/tests/layout/style/test/ccd.sjs?JD3ls">
+<script>
+// attach onload and onerror handlers to every link tag, then activate
+// them.  see audit logic in test_css_cross_domain.html
+function setCompleted() {
+  this.dataset.completed = true;
+}
 
+var links = document.getElementsByTagName("link");
+for (var i = 0; i < links.length; i++) {
+  links[i].dataset.completed = false;
+  links[i].addEventListener("load", setCompleted);
+  links[i].addEventListener("error", setCompleted);
+  links[i].href = links[i].dataset.href;
+}
+</script>
 </head><body>
 <div></div>
 <div></div>
 <div><p id="IA1i"></p><p id="IA1l"></p></div>
 <div><p id="IA2i"></p><p id="IA2l"></p></div>
 <div><p id="IA3i"></p><p id="IA3l"></p></div>
 <div></div>
 <div><p id="IB1i"></p><p id="IB1l"></p></div>
--- a/layout/style/test/test_css_cross_domain.html
+++ b/layout/style/test/test_css_cross_domain.html
@@ -74,26 +74,48 @@
 <iframe id="standards" src="ccd-standards.html"></iframe>
 </div>
 
 <script type="application/javascript">
 
 /** Test for Bug 524223 **/
 function check_iframe(ifr) {
     var doc = ifr.contentDocument;
+    var i;
+
+    // Check that all links have in fact either loaded or errored.
+    // Doesn't seem to be possible to do this for @import, but this is
+    // just a diagnostic, anyway.  See corresponding code in ccd-*.html.
+    var links = doc.getElementsByTagName("link");
+    for (i = 0; i < links.length; i++) {
+       ok(links[i].dataset.completed, ifr.id + " " + links[i].href + " loaded");
+    }
+
     var cases = doc.getElementsByTagName("p");
-    for (var i = 0; i < cases.length; i++) {
+    for (i = 0; i < cases.length; i++) {
 	var color = doc.defaultView.getComputedStyle(cases[i], "")
 	    .getPropertyValue("background-color");
 
 	is(color, "rgb(0, 255, 0)", ifr.id + " " + cases[i].id);
     }
 }
 
+var quirks = document.getElementById("quirks");
+var standards = document.getElementById("standards");
+var quirks_loaded = false;
+var standards_loaded = false;
+
 SimpleTest.waitForExplicitFinish();
+
+quirks.onload = function() { quirks_loaded = true; }
+standards.onload = function() { standards_loaded = true; }
+
 window.onload = function() {
-    check_iframe(document.getElementById("quirks"));
-    check_iframe(document.getElementById("standards"));
+    ok(quirks_loaded, "quirks frame loaded");
+    ok(standards_loaded, "standards frame loaded");
+
+    check_iframe(quirks);
+    check_iframe(standards);
     SimpleTest.finish();
 };
 </script>
 </body>
 </html>