[Pkg-javascript-commits] [less.js] 262/285: increase timeout and fix tests not supported in IE8-10

Jonas Smedegaard dr at jones.dk
Mon Oct 26 23:24:00 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 e0f9f21132ce4267c56dcd28270a692be0db9f89
Author: Luke Page <luke.a.page at gmail.com>
Date:   Sun Nov 2 16:50:07 2014 +0000

    increase timeout and fix tests not supported in IE8-10
---
 Gruntfile.js                           |  2 +-
 test/browser/runner-browser-options.js | 18 +++++++++++++-----
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/Gruntfile.js b/Gruntfile.js
index 1911799..ec9ffa8 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -276,7 +276,7 @@ module.exports = function (grunt) {
                         platform: 'Windows 8.1'
                     }],
                     sauceConfig: {
-                        'record-video': false, 'record-screenshots': false, 'idle-timeout': 100, 'max-duration': 240,
+                        'record-video': false, 'record-screenshots': false, 'idle-timeout': 100, 'max-duration': 480,
                         build: process.env.TRAVIS_JOB_ID,
                         tags: [process.env.TRAVIS_BUILD_NUMBER, process.env.TRAVIS_PULL_REQUEST, process.env.TRAVIS_BRANCH]
                     },
diff --git a/test/browser/runner-browser-options.js b/test/browser/runner-browser-options.js
index 6eadfd6..aaf546b 100644
--- a/test/browser/runner-browser-options.js
+++ b/test/browser/runner-browser-options.js
@@ -10,6 +10,11 @@ var less = {logLevel: 4, errorReporting: "console"};
 var testFiles = ['charsets', 'colors', 'comments', 'css-3', 'strings', 'media', 'mixins'],
     testSheets = [];
 
+// IE 8-10 does not support less in style tags
+if (window.navigator.userAgent.indexOf("MSIE") >= 0) {
+    testFiles.length = 0;
+}
+
 // setup style tags with less and link tags pointing to expected css output
 
 for (var i = 0; i < testFiles.length; i++) {
@@ -24,10 +29,8 @@ for (var i = 0; i < testFiles.length; i++) {
   lessStyle.id = file;
   lessStyle.href = file;
 
-  if (lessStyle.styleSheet) {
-    lessStyle.styleSheet.cssText = lessText;
-  } else {
-    lessStyle.innerHTML = lessText;
+  if (lessStyle.styleSheet === undefined) {
+    lessStyle.appendChild(document.createTextNode(lessText));
   }
 
   cssLink.rel = 'stylesheet';
@@ -38,6 +41,11 @@ for (var i = 0; i < testFiles.length; i++) {
   var head = document.getElementsByTagName('head')[0];
 
   head.appendChild(lessStyle);
+
+  if (lessStyle.styleSheet) {
+    lessStyle.styleSheet.cssText = lessText;
+  }
+
   head.appendChild(cssLink);
   testSheets[i] = lessStyle;
-}
\ No newline at end of file
+}

-- 
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