Fix minor splitruntest.html bug
authorAryeh Gregor <AryehGregor+gitcommit@gmail.com>
Mon, 19 Sep 2011 12:31:53 -0600
changeset 591 f82c77108bbc
parent 590 3a8b64badbdb
child 592 fdae0266614c
Fix minor splitruntest.html bug

Was causing bogus WebKit fails and Gecko passes in one of the first
tests on every run, when checking styleWithCSS state. The gentest.html
expected results say that styleWithCSS should be true at that point, but
it was false.
conformancetest/splitruntest.html
--- a/conformancetest/splitruntest.html	Mon Sep 19 11:59:34 2011 -0600
+++ b/conformancetest/splitruntest.html	Mon Sep 19 12:31:53 2011 -0600
@@ -53,8 +53,12 @@
 		}
 	}
 
+	var firstGroup = null;
 	var pickerContents = "Select a group of tests to run:";
 	for (var group in groupedBrowserTests) {
+		if (firstGroup === null) {
+			firstGroup = group;
+		}
 		pickerContents += " <a href=?" + group + ">" + group + "</a>";
 	}
 	document.querySelector("#picker").innerHTML = pickerContents;
@@ -63,6 +67,16 @@
 	if (!(command in groupedBrowserTests)) {
 		return;
 	}
+	if (command !== firstGroup) {
+		// Silly hack: the CSS styling flag should be true, not false, to match
+		// expected results.  This is because every group of tests except the
+		// last (multitest) sets styleWithCSS automatically, and it sets it
+		// first to false and then to true.  Thus it's left at true at the end
+		// of each group of tests, so in gentest.html it will be true when
+		// starting each group of tests other than the first.  But browsers are
+		// supposed to default it to false when the page loads, so flip it.
+		try { document.execCommand("styleWithCSS", false, "true") } catch(e) {}
+	}
 	browserTests = groupedBrowserTests[command];
 
 	browserTests.forEach(runConformanceTest);