]> git.parisson.com Git - pdf.js.git/commitdiff
Removing introduced by the test run DOM elements
authornotmasteryet <async.processingjs@yahoo.com>
Thu, 22 Sep 2011 23:04:50 +0000 (18:04 -0500)
committernotmasteryet <async.processingjs@yahoo.com>
Thu, 22 Sep 2011 23:04:50 +0000 (18:04 -0500)
test/driver.js
test/test_slave.html

index 7d6c545092c4552ee5d149f54d6da91f83304328..db6c9b5013481cc36b36b86066e37feaa4ced8fa 100644 (file)
@@ -50,7 +50,20 @@ function load() {
   r.send(null);
 }
 
+function cleanup() {
+  var styleSheet = document.styleSheets[0];
+  if (styleSheet) {
+    while (styleSheet.cssRules.length > 0)
+      styleSheet.deleteRule(0);
+  }
+  var guard = document.getElementById('content-end');
+  while (document.body.lastChild != guard)
+    document.body.removeChild(document.body.lastChild);
+}
+
 function nextTask() {
+  cleanup();
+
   if (currentTaskIdx == manifest.length) {
     return done();
   }
index b46e29d6b25a1d942565bdbf7b793fd7d68779a6..57d8d7a835d37bba40bd27f5c134d10e3f658d0a 100644 (file)
@@ -14,6 +14,7 @@
 <body onload="load();">
   <pre style="width:800; height:800; overflow: scroll;"id="stdout"></pre>
   <p>Inflight requests: <span id="inFlightCount"></span></p>
+  <div id="content-end"><!-- cleanup() guard --></div>
 </body>
 
 </html>