Allow not running browser tests in autoimplementation
authorAryeh Gregor <AryehGregor+gitcommit@gmail.com>
Thu, 26 May 2011 11:52:13 -0600
changeset 180 beea6b6c9d05
parent 179 80d0b644c1f8
child 181 82126988dd3f
Allow not running browser tests in autoimplementation

This can speed things up a lot if you just want to do regression
testing. Also put the checkboxes in an annoying position: fixed div.
autoimplementation.html
--- a/autoimplementation.html	Thu May 26 11:37:49 2011 -0600
+++ b/autoimplementation.html	Thu May 26 11:52:13 2011 -0600
@@ -5,7 +5,8 @@
 body { font-family: serif }
 .yes { color: green }
 .no { color: red }
-.yes, .no {
+.maybe { color: orange }
+.yes, .no, .maybe {
 	text-align: center;
 	vertical-align: middle;
 	font-size: 3em;
@@ -56,6 +57,15 @@
 body > div > table > tbody > tr > th:last-child {
 	width: 10%;
 }
+#toolbar {
+	position: fixed;
+	top: 0;
+	left: 0;
+	right: 0;
+	height: 1.5em;
+	background: white;
+	border-bottom: 2px solid gray;
+}
 /* For testing */
 ol ol { list-style-type: lower-alpha }
 ol ol ol { list-style-type: lower-roman }
@@ -74,15 +84,19 @@
 styleWithCSS false and the second is with it true.  (The second table is left
 blank in IE and Opera, which don't support styleWithCSS.)
 
-<p>
+<div id=toolbar>
 <!-- Note: this is completely not a hack at all. -->
 <style id=alerts>/* tr:not(.alert):not(:first-child) { display: none } */</style>
 
-<label><input id=alert-checkbox type=checkbox accesskey=a checked onclick='updateAlertRowStyle()'> Display rows without spec alerts</label>
+<label><input id=alert-checkbox type=checkbox accesskey=a checked onclick='updateAlertRowStyle()'> Display rows without spec <u>a</u>lerts</label>
+
+<label><input id=browser-checkbox type=checkbox accesskey=b checked> Run <u>b</u>rowser tests as well as spec tests</label>
 
 <script>
 // Confusingly, we're storing a string here, not a boolean.
 document.querySelector("#alert-checkbox").checked = localStorage["display-alerts"] != "false";
+document.querySelector("#browser-checkbox").checked = localStorage["display-browser-tests"] != "false";
+
 function updateAlertRowStyle() {
 	var checked = document.querySelector("#alert-checkbox").checked;
 	var style = document.querySelector("#alerts");
@@ -95,6 +109,7 @@
 }
 updateAlertRowStyle();
 </script>
+</div>
 
 <h1>Table of Contents</h1>
 <ul>
@@ -2102,6 +2117,11 @@
 
 	var browserCell = document.createElement("td");
 	tr.appendChild(browserCell);
+	if (!document.querySelector("#browser-checkbox").checked) {
+		browserCell.textContent = "(skipped)";
+		return;
+	}
+
 	try {
 		var points = setupCell(browserCell, test);
 
@@ -2213,7 +2233,10 @@
 	} catch (e) {
 		exception = true;
 	}
-	if (!exception && normalizedSpecCell == normalizedBrowserCell) {
+	if (!document.querySelector("#browser-checkbox").checked) {
+		sameCell.className = "maybe";
+		sameCell.textContent = "?";
+	} else if (!exception && normalizedSpecCell == normalizedBrowserCell) {
 		sameCell.className = "yes";
 		sameCell.textContent = "\u2713";
 	} else {