From fff77db4f11dc08b68e9359c5e56f32b9c41aadc Mon Sep 17 00:00:00 2001 From: Brett Zamir Date: Thu, 17 May 2018 12:57:51 +0800 Subject: [PATCH] Test summary: two tests failing: draw.js (releaseId), svgedit.recalculate (text w/tspan with simple translate) - Testing: Add node-static to get tests working - Testing: Fix timing for ensuring expanding iframe size to fit content - Testing: Add favicon to test files - Refactoring: Move scripts to own files and lint --- editor/browser-not-supported.html | 10 +------ editor/browser-not-supported.js | 8 ++++++ opera-widget/index.html | 2 +- package-lock.json | 41 +++++++++++++++++++++++++++++ package.json | 5 +++- screencasts/svgopen2010/index.html | 2 +- test/all_tests.html | 1 + test/all_tests.js | 18 ++++++++----- test/contextmenu_test.html | 5 +++- test/coords_test.html | 1 + test/draw_test.html | 1 + test/history_test.html | 1 + test/jquery-svg_test.html | 1 + test/math_test.html | 1 + test/path_test.html | 1 + test/recalculate_test.html | 1 + test/sanitize_test.html | 1 + test/select_test.html | 1 + test/svgtransformlist_test.html | 3 ++- test/svgutils_bbox_test.html | 1 + test/svgutils_performance_test.html | 1 + test/svgutils_test.html | 1 + test/test1.html | 1 + test/units_test.html | 1 + 24 files changed, 88 insertions(+), 21 deletions(-) create mode 100644 editor/browser-not-supported.js diff --git a/editor/browser-not-supported.html b/editor/browser-not-supported.html index 8553f50e..81381847 100644 --- a/editor/browser-not-supported.html +++ b/editor/browser-not-supported.html @@ -27,14 +27,6 @@ Google Chrome Frame plugin.

- + diff --git a/editor/browser-not-supported.js b/editor/browser-not-supported.js new file mode 100644 index 00000000..b87ec308 --- /dev/null +++ b/editor/browser-not-supported.js @@ -0,0 +1,8 @@ +/* eslint-disable no-var */ +/* globals $ */ +var viewportHeight = window.innerHeight || ($(window).height() - 140); +var iframe = document.createElement('iframe'); +iframe.style.width = '100%'; +iframe.style.height = viewportHeight + 'px'; +iframe.src = 'http://caniuse.com/#cats=SVG'; +document.body.appendChild(iframe); diff --git a/opera-widget/index.html b/opera-widget/index.html index e61841d1..a7c68cd8 100644 --- a/opera-widget/index.html +++ b/opera-widget/index.html @@ -5,7 +5,7 @@ SVG Edit - + diff --git a/test/all_tests.html b/test/all_tests.html index 32ce315c..b79fdabd 100644 --- a/test/all_tests.html +++ b/test/all_tests.html @@ -2,6 +2,7 @@ + All SVG-edit Tests diff --git a/test/all_tests.js b/test/all_tests.js index 918d0f36..df31038e 100644 --- a/test/all_tests.js +++ b/test/all_tests.js @@ -1,8 +1,12 @@ /* eslint-disable no-var */ -window.setTimeout(function () { - var iframes = document.getElementsByTagName('iframe'); - for (var i = 0, len = iframes.length; i < len; ++i) { - var f = iframes[i]; - f.style.height = (f.contentDocument.body.scrollHeight + 20) + 'px'; - } -}, 5000); +var iframes = document.getElementsByTagName('iframe'); +for (var i = 0, len = iframes.length; i < len; ++i) { + var f = iframes[i]; + (function (f) { + f.addEventListener('load', function () { + f.contentWindow.QUnit.done = function () { + f.style.height = (f.contentDocument.body.scrollHeight + 20) + 'px'; + }; + }); + })(f); +} diff --git a/test/contextmenu_test.html b/test/contextmenu_test.html index 76a65a09..df0162b5 100644 --- a/test/contextmenu_test.html +++ b/test/contextmenu_test.html @@ -3,11 +3,14 @@ Unit Tests for contextmenu.js + diff --git a/test/coords_test.html b/test/coords_test.html index 5183aa66..f76ed015 100644 --- a/test/coords_test.html +++ b/test/coords_test.html @@ -3,6 +3,7 @@ Unit Tests for coords.js + diff --git a/test/draw_test.html b/test/draw_test.html index 1014a90a..d96dc822 100644 --- a/test/draw_test.html +++ b/test/draw_test.html @@ -3,6 +3,7 @@ Unit Tests for draw.js + diff --git a/test/history_test.html b/test/history_test.html index c6e64d95..06fa4649 100644 --- a/test/history_test.html +++ b/test/history_test.html @@ -3,6 +3,7 @@ Unit Tests for history.js + diff --git a/test/jquery-svg_test.html b/test/jquery-svg_test.html index 596db970..9d90ed3f 100644 --- a/test/jquery-svg_test.html +++ b/test/jquery-svg_test.html @@ -3,6 +3,7 @@ Unit Tests for jquery-svg.js + diff --git a/test/math_test.html b/test/math_test.html index 831ed8f4..47dec93e 100644 --- a/test/math_test.html +++ b/test/math_test.html @@ -3,6 +3,7 @@ Unit Tests for math.js + diff --git a/test/path_test.html b/test/path_test.html index b62c1cea..c732f0c1 100644 --- a/test/path_test.html +++ b/test/path_test.html @@ -3,6 +3,7 @@ Unit Tests for path.js + diff --git a/test/recalculate_test.html b/test/recalculate_test.html index 908695a3..63202772 100644 --- a/test/recalculate_test.html +++ b/test/recalculate_test.html @@ -3,6 +3,7 @@ Unit Tests for recalculate.js + diff --git a/test/sanitize_test.html b/test/sanitize_test.html index 4a8a0147..ebf74b09 100644 --- a/test/sanitize_test.html +++ b/test/sanitize_test.html @@ -3,6 +3,7 @@ Unit Tests for sanitize.js + diff --git a/test/select_test.html b/test/select_test.html index f753bd86..a94b6351 100644 --- a/test/select_test.html +++ b/test/select_test.html @@ -3,6 +3,7 @@ Unit Tests for select.js + diff --git a/test/svgtransformlist_test.html b/test/svgtransformlist_test.html index 82c6a8a8..1158e02a 100644 --- a/test/svgtransformlist_test.html +++ b/test/svgtransformlist_test.html @@ -3,13 +3,14 @@ Unit Tests for svgtransformlist.js + diff --git a/test/svgutils_bbox_test.html b/test/svgutils_bbox_test.html index f1677022..d19f0a7f 100644 --- a/test/svgutils_bbox_test.html +++ b/test/svgutils_bbox_test.html @@ -3,6 +3,7 @@ Unit Tests for svgutils.js BBox functions + diff --git a/test/svgutils_performance_test.html b/test/svgutils_performance_test.html index 26bffb62..130ceb43 100644 --- a/test/svgutils_performance_test.html +++ b/test/svgutils_performance_test.html @@ -6,6 +6,7 @@ Performance Unit Tests for svgutils.js + diff --git a/test/svgutils_test.html b/test/svgutils_test.html index 149c5a63..eed4255d 100644 --- a/test/svgutils_test.html +++ b/test/svgutils_test.html @@ -3,6 +3,7 @@ Unit Tests for svgutils.js + diff --git a/test/test1.html b/test/test1.html index 64d12401..635f8ba6 100644 --- a/test/test1.html +++ b/test/test1.html @@ -3,6 +3,7 @@ Unit Tests for SvgCanvas + diff --git a/test/units_test.html b/test/units_test.html index 44dacbde..585a01aa 100644 --- a/test/units_test.html +++ b/test/units_test.html @@ -3,6 +3,7 @@ Unit Tests for units.js +