[Pkg-javascript-commits] [less.js] 177/285: use page load finished in tests

Jonas Smedegaard dr at jones.dk
Mon Oct 26 23:23:51 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag v2.0.0
in repository less.js.

commit 55baaa5db112aea5ff4aeaac299b720d66ee76af
Author: Luke Page <luke.a.page at gmail.com>
Date:   Sat Oct 18 07:48:47 2014 +0100

    use page load finished in tests
---
 test/browser/common.js | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/test/browser/common.js b/test/browser/common.js
index 40ec8eb..31f248f 100644
--- a/test/browser/common.js
+++ b/test/browser/common.js
@@ -54,17 +54,21 @@ var testSheet = function(sheet) {
       lessOutputObj,
       lessOutput,
       expectedOutputHref = document.getElementById(expectedOutputId).href,
-      expectedOutput = loadFile(expectedOutputHref);
+      expectedOutput = loadFile(expectedOutputHref),
+      finished = false;
 
     // Browser spec generates less on the fly, so we need to loose control
+    less.pageLoadFinished
+        .then(function() {
+            finished = true;
+        });
     waitsFor(function() {
-      lessOutputObj = document.getElementById(lessOutputId);
-      // the type condition is necessary because of inline browser tests
-      return lessOutputObj !== null && lessOutputObj.type === "text/css";
+      return finished;
     }, "generation of " + lessOutputId + "", 700);
 
     runs(function() {
-      lessOutput = lessOutputObj.innerText || lessOutputObj.innerHTML;
+        lessOutputObj = document.getElementById(lessOutputId);
+        lessOutput = lessOutputObj.innerText || lessOutputObj.innerHTML;
     });
 
     waitsFor(function() {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/less.js.git



More information about the Pkg-javascript-commits mailing list