- convert svgutils_test.html from utf8 to iso-8859-1 (Western) encoding,

so that tools such as grep don't consider it a binary file.
- add <title> to test pages, to make html valid
- harmonize indentation: 2 spaces
- harmonize all empty html elements' closing tags
  to be on the same line as the opening tag



git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2418 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Waldir Pimenta 2013-02-17 17:28:19 +00:00
parent 164b22d0c1
commit 3d71cdf27b
12 changed files with 2087 additions and 2091 deletions

View File

@ -1,16 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<link rel='stylesheet' href='qunit/qunit.css' type='text/css'/>
<script src='../editor/jquery.js'></script>
<script>
// Mock for browser.js
window.svgEditor = {ready:function(){}};
</script>
<script src='../editor/contextmenu.js'></script>
<script src='qunit/qunit.js'></script>
<script>
$(function() {
<title>Unit Tests for contextmenu.js</title>
<link rel='stylesheet' href='qunit/qunit.css' type='text/css'/>
<script src='../editor/jquery.js'></script>
<script>
// Mock for browser.js
window.svgEditor = {ready:function(){}};
</script>
<script src='../editor/contextmenu.js'></script>
<script src='qunit/qunit.js'></script>
<script>
$(function() {
// log function
QUnit.log = function(result, message) {
if (window.console && window.console.log) {
@ -68,15 +69,14 @@ $(function() {
equals(svgedit.contextmenu.getCustomHandler("valid"),validItem1.action,"duplicate menu item is rejected.");
tearDown();
});
});
</script>
});
</script>
</head>
<body>
<h1 id='qunit-header'>Unit Tests for contextmenu.js</h1>
<h2 id='qunit-banner'></h2>
<h2 id='qunit-userAgent'></h2>
<ol id='qunit-tests'>
</ol>
<ol id='qunit-tests'></ol>
<div id='svgroot' style='visibility:hidden'></div>
</body>
</html>

View File

@ -1,6 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>Unit Tests for coords.js</title>
<link rel='stylesheet' href='qunit/qunit.css' type='text/css'/>
<script type='text/javascript' src='../editor/jquery.js'></script>
<script type='text/javascript' src='../editor/svgedit.js'></script>
@ -326,8 +327,7 @@
<h1 id='qunit-header'>Unit Tests for svgedit.coords</h1>
<h2 id='qunit-banner'></h2>
<h2 id='qunit-userAgent'></h2>
<ol id='qunit-tests'>
</ol>
<ol id='qunit-tests'></ol>
<div id='svgroot' style='visibility:hidden'></div>
</body>
</html>

View File

@ -1,15 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<link rel='stylesheet' href='qunit/qunit.css' type='text/css'/>
<script src='../editor/jquery.js'></script>
<script src='../editor/svgedit.js'></script>
<script src='../editor/browser.js'></script>
<script src='../editor/svgutils.js'></script>
<script src='../editor/draw.js'></script>
<script src='qunit/qunit.js'></script>
<script>
$(function() {
<title>Unit Tests for draw.js</title>
<link rel='stylesheet' href='qunit/qunit.css' type='text/css'/>
<script src='../editor/jquery.js'></script>
<script src='../editor/svgedit.js'></script>
<script src='../editor/browser.js'></script>
<script src='../editor/svgutils.js'></script>
<script src='../editor/draw.js'></script>
<script src='qunit/qunit.js'></script>
<script>
$(function() {
// log function
QUnit.log = function(result, message) {
if (window.console && window.console.log) {
@ -520,16 +521,14 @@ $(function() {
ok(!drawing.getNonce());
});
});
</script>
});
</script>
</head>
<body>
<h1 id='qunit-header'>Unit Tests for draw.js</h1>
<h2 id='qunit-banner'></h2>
<h2 id='qunit-userAgent'></h2>
<ol id='qunit-tests'>
</ol>
<div id='anchor' style='visibility:hidden'>
</div>
<ol id='qunit-tests'></ol>
<div id='anchor' style='visibility:hidden'></div>
</body>
</html>

View File

@ -1,12 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<link rel='stylesheet' href='qunit/qunit.css' type='text/css'/>
<script src='../editor/jquery.js'></script>
<script src='../editor/history.js'></script>
<script src='qunit/qunit.js'></script>
<script>
$(function() {
<title>Unit Tests for history.js</title>
<link rel='stylesheet' href='qunit/qunit.css' type='text/css'/>
<script src='../editor/jquery.js'></script>
<script src='../editor/history.js'></script>
<script src='qunit/qunit.js'></script>
<script>
$(function() {
// TODO(codedread): Write tests for handling history events.
// Mocked out methods.
@ -568,15 +569,14 @@ $(function() {
tearDown();
});
});
</script>
});
</script>
</head>
<body>
<h1 id='qunit-header'>Unit Tests for history.js</h1>
<h2 id='qunit-banner'></h2>
<h2 id='qunit-userAgent'></h2>
<ol id='qunit-tests'>
</ol>
<ol id='qunit-tests'></ol>
<div id='divparent' style='visibility:hidden'>
<div id='div1'></div>
<div id='div2'></div>

View File

@ -1,13 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<link rel='stylesheet' href='qunit/qunit.css' type='text/css'/>
<script src='../editor/jquery.js'></script>
<script src='../editor/svgedit.js'></script>
<script src='../editor/math.js'></script>
<script src='qunit/qunit.js'></script>
<script>
$(function() {
<title>Unit Tests for math.js</title>
<link rel='stylesheet' href='qunit/qunit.css' type='text/css'/>
<script src='../editor/jquery.js'></script>
<script src='../editor/svgedit.js'></script>
<script src='../editor/math.js'></script>
<script src='qunit/qunit.js'></script>
<script>
$(function() {
// log function
QUnit.log = function(result, message) {
if (window.console && window.console.log) {
@ -125,14 +126,13 @@ $(function() {
equals(r.aabox.width, 200);
equals(r.aabox.height, 300);
});
});
</script>
});
</script>
</head>
<body>
<h1 id='qunit-header'>Unit Tests for math.js</h1>
<h2 id='qunit-banner'></h2>
<h2 id='qunit-userAgent'></h2>
<ol id='qunit-tests'>
</ol>
<ol id='qunit-tests'></ol>
</body>
</html>

View File

@ -1,28 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<link rel='stylesheet' href='qunit/qunit.css' type='text/css'/>
<script src='../editor/jquery.js'></script>
<script src='../editor/path.js'></script>
<script src='qunit/qunit.js'></script>
<script>
$(function() {
<title>Unit Tests for path.js</title>
<link rel='stylesheet' href='qunit/qunit.css' type='text/css'/>
<script src='../editor/jquery.js'></script>
<script src='../editor/path.js'></script>
<script src='qunit/qunit.js'></script>
<script>
$(function() {
// log function
QUnit.log = function(result, message) {
if (window.console && window.console.log) {
window.console.log(result +' :: '+ message);
}
};
});
</script>
});
</script>
</head>
<body>
<h1 id='qunit-header'>Unit Tests for path.js</h1>
<h2 id='qunit-banner'></h2>
<h2 id='qunit-userAgent'></h2>
<ol id='qunit-tests'>
</ol>
<div id='anchor' style='visibility:hidden'>
</div>
<ol id='qunit-tests'></ol>
<div id='anchor' style='visibility:hidden'></div>
</body>
</html>

View File

@ -1,15 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<link rel='stylesheet' href='qunit/qunit.css' type='text/css'/>
<script src='../editor/jquery.js'></script>
<script src='../editor/svgedit.js'></script>
<script src='../editor/browser.js'></script>
<script src='../editor/svgutils.js'></script>
<script src='../editor/sanitize.js'></script>
<script src='qunit/qunit.js'></script>
<script>
$(function() {
<title>Unit Tests for sanitize.js</title>
<link rel='stylesheet' href='qunit/qunit.css' type='text/css'/>
<script src='../editor/jquery.js'></script>
<script src='../editor/svgedit.js'></script>
<script src='../editor/browser.js'></script>
<script src='../editor/svgutils.js'></script>
<script src='../editor/sanitize.js'></script>
<script src='qunit/qunit.js'></script>
<script>
$(function() {
// log function
QUnit.log = function(result, message) {
if (window.console && window.console.log) {
@ -39,9 +40,7 @@ $(function() {
<h1 id='qunit-header'>Unit Tests for sanitize.js</h1>
<h2 id='qunit-banner'></h2>
<h2 id='qunit-userAgent'></h2>
<ol id='qunit-tests'>
</ol>
<div id='anchor' style='visibility:hidden'>
</div>
<ol id='qunit-tests'></ol>
<div id='anchor' style='visibility:hidden'></div>
</body>
</html>

View File

@ -1,16 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<link rel='stylesheet' href='qunit/qunit.css' type='text/css'/>
<script src='../editor/jquery.js'></script>
<script src='../editor/svgedit.js'></script>
<script src='../editor/browser.js'></script>
<script src='../editor/math.js'></script>
<script src='../editor/svgutils.js'></script>
<script src='../editor/select.js'></script>
<script src='qunit/qunit.js'></script>
<script>
$(function() {
<title>Unit Tests for select.js</title>
<link rel='stylesheet' href='qunit/qunit.css' type='text/css'/>
<script src='../editor/jquery.js'></script>
<script src='../editor/svgedit.js'></script>
<script src='../editor/browser.js'></script>
<script src='../editor/math.js'></script>
<script src='../editor/svgutils.js'></script>
<script src='../editor/select.js'></script>
<script src='qunit/qunit.js'></script>
<script>
$(function() {
// log function
QUnit.log = function(result, message) {
if (window.console && window.console.log) {
@ -138,15 +139,14 @@ $(function() {
tearDown();
});
});
</script>
});
</script>
</head>
<body>
<h1 id='qunit-header'>Unit Tests for select.js</h1>
<h2 id='qunit-banner'></h2>
<h2 id='qunit-userAgent'></h2>
<ol id='qunit-tests'>
</ol>
<ol id='qunit-tests'></ol>
<div id='sandbox'></div>
</body>
</html>

View File

@ -1,18 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<link rel='stylesheet' href='qunit/qunit.css' type='text/css'/>
<script src='../editor/jquery.js'></script>
<script src='../editor/svgedit.js'></script>
<script>
// Mock for browser.js
svgedit.browser = {};
svgedit.browser.supportsNativeTransformLists = function() { return false;}
</script>
<script src='../editor/svgtransformlist.js'></script>
<script src='qunit/qunit.js'></script>
<script>
$(function() {
<title>Unit Tests for svgtransformlist.js</title>
<link rel='stylesheet' href='qunit/qunit.css' type='text/css'/>
<script src='../editor/jquery.js'></script>
<script src='../editor/svgedit.js'></script>
<script>
// Mock for browser.js
svgedit.browser = {};
svgedit.browser.supportsNativeTransformLists = function() { return false;}
</script>
<script src='../editor/svgtransformlist.js'></script>
<script src='qunit/qunit.js'></script>
<script>
$(function() {
// log function
QUnit.log = function(result, message) {
if (window.console && window.console.log) {
@ -112,7 +113,7 @@ $(function() {
// remove it from its old list and add it to this list.
cxform.initialize(t);
// This also fails in Firefox native.
// equals(rxform.numberOfItems, 0, 'Did not remove transform from list before initializing another transformlist');
// equals(rxform.numberOfItems, 0, 'Did not remove transform from list before initializing another transformlist');
equals(cxform.numberOfItems, 1);
tearDown();
@ -148,9 +149,9 @@ $(function() {
checkOutOfBoundsException(rxform, 'getItem', 3);
cxform.appendItem(t1);
// These also fail in Firefox native.
// equals(rxform.numberOfItems, 2, 'Did not remove a transform from a list before appending it to a new transformlist');
// equals(rxform.getItem(0), t2, 'Found the wrong transform in a transformlist');
// equals(rxform.getItem(1), t3, 'Found the wrong transform in a transformlist');
// equals(rxform.numberOfItems, 2, 'Did not remove a transform from a list before appending it to a new transformlist');
// equals(rxform.getItem(0), t2, 'Found the wrong transform in a transformlist');
// equals(rxform.getItem(1), t3, 'Found the wrong transform in a transformlist');
equals(cxform.numberOfItems, 1);
equals(cxform.getItem(0), t1);
@ -205,13 +206,13 @@ $(function() {
equals(rxform.getItem(0), t3);
equals(rxform.getItem(1), t2);
// Fails in Firefox native
// equals(cxform.numberOfItems, 0);
// equals(cxform.numberOfItems, 0);
// test replaceItem within a list
rxform.appendItem(t1);
rxform.replaceItem(t1, 0);
// Fails in Firefox native
// equals(rxform.numberOfItems, 2);
// equals(rxform.numberOfItems, 2);
equals(rxform.getItem(0), t1);
equals(rxform.getItem(1), t2);
@ -243,11 +244,11 @@ $(function() {
equals(rxform.getItem(1), t1);
equals(rxform.getItem(2), t2);
// Fails in Firefox native
// equals(cxform.numberOfItems, 0);
// equals(cxform.numberOfItems, 0);
rxform.insertItemBefore(t2, 1);
// Fails in Firefox native (they make copies of the transforms)
// equals(rxform.numberOfItems, 3);
// equals(rxform.numberOfItems, 3);
equals(rxform.getItem(0), t3);
equals(rxform.getItem(1), t2);
equals(rxform.getItem(2), t1);
@ -401,15 +402,14 @@ $(function() {
tearDown();
});
});
</script>
});
</script>
</head>
<body>
<h1 id='qunit-header'>Unit Tests for svgtransformlist.js</h1>
<h2 id='qunit-banner'></h2>
<h2 id='qunit-userAgent'></h2>
<ol id='qunit-tests'>
</ol>
<ol id='qunit-tests'></ol>
<div id='svgroot' style='visibility:hidden'></div>
</body>
</html>

View File

@ -1,16 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<link rel='stylesheet' href='qunit/qunit.css' type='text/css'/>
<script src='../editor/jquery.js'></script>
<script src='../editor/svgedit.js'></script>
<!-- svgutils.js depends on these two... mock out? -->
<script src='../editor/browser.js'></script>
<script src='../editor/svgtransformlist.js'></script>
<script src='../editor/svgutils.js'></script>
<script src='qunit/qunit.js'></script>
<script>
$(function() {
<title>Unit Tests for svgutils.js</title>
<link rel='stylesheet' href='qunit/qunit.css' type='text/css'/>
<script src='../editor/jquery.js'></script>
<script src='../editor/svgedit.js'></script>
<!-- svgutils.js depends on these two... mock out? -->
<script src='../editor/browser.js'></script>
<script src='../editor/svgtransformlist.js'></script>
<script src='../editor/svgutils.js'></script>
<script src='qunit/qunit.js'></script>
<script>
$(function() {
// log function
QUnit.log = function(result, message) {
if (window.console && window.console.log) {
@ -79,7 +80,7 @@ $(function() {
var convert = svgedit.utilities.convertToXMLReferences;
equals(convert('ABC'), 'ABC');
// equals(convert('ÀBC'), '&#192;BC');
// equals(convert('ÀBC'), '&#192;BC');
});
test('Test svgedit.utilities.bboxToObj() function', function() {
@ -120,14 +121,13 @@ $(function() {
ok(bb.y && !isNaN(bb.y));
});
});
</script>
});
</script>
</head>
<body>
<h1 id='qunit-header'>Unit Tests for svgutils.js</h1>
<h2 id='qunit-banner'></h2>
<h2 id='qunit-userAgent'></h2>
<ol id='qunit-tests'>
</ol>
<ol id='qunit-tests'></ol>
</body>
</html>

View File

@ -1,6 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>Unit Tests for SvgCanvas</title>
<link rel="stylesheet" href="qunit/qunit.css" type="text/css"/>
<script src="../editor/jquery.js"></script>
<script src="../editor/jquerybbq/jquery.bbq.min.js"></script>
@ -160,12 +161,12 @@
var attrVal = document.getElementById('se_test_elem').getAttributeNS("http://svg-edit.googlecode.com", "foo");
equal(attrVal === "bar", true, "Preserved namespaced attribute on import");
//
// console.log('getSvgString' in svgCanvas)
//
//console.log('getSvgString' in svgCanvas)
var output = svgCanvas.getSvgString();
// } catch(e) {console.log(e)}
// console.log('output',output);
//} catch(e) {console.log(e)}
//console.log('output',output);
var has_xlink = output.indexOf('xmlns:xlink="http://www.w3.org/1999/xlink"') !== -1;
var has_se = output.indexOf('xmlns:se=') !== -1;
var has_foo = output.indexOf('xmlns:foo=') !== -1;
@ -255,8 +256,8 @@
uses = svgcontent.getElementsByTagNameNS(svgns, "use");
notEqual(circles.item(0).id, "svg_1", "Circle not re-identified");
notEqual(rects.item(0).id, "svg_3", "Rectangle not re-identified");
// // TODO: determine why this test fails in WebKit browsers
// equal(grads.length, 1, "Linear gradient imported");
// TODO: determine why this test fails in WebKit browsers
//equal(grads.length, 1, "Linear gradient imported");
var grad = defs.item(0).firstChild;
notEqual(grad.id, "svg_2", "Linear gradient not re-identified");
notEqual(circles.item(0).getAttribute("fill"), "url(#svg_2)", "Circle fill value not remapped");
@ -271,8 +272,7 @@
<h1 id="qunit-header">Unit Tests for SvgCanvas</h1>
<h2 id="qunit-banner"></h2>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests">
</ol>
<ol id="qunit-tests"></ol>
<div id="svg_editor">
<div id="workarea">
<div id="svgcanvas" style="visibility:hidden"></div>

View File

@ -1,13 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<link rel='stylesheet' href='qunit/qunit.css' type='text/css'/>
<script src='../editor/jquery.js'></script>
<script src='../editor/svgedit.js'></script>
<script src='../editor/units.js'></script>
<script src='qunit/qunit.js'></script>
<script>
$(function() {
<title>Unit Tests for units.js</title>
<link rel='stylesheet' href='qunit/qunit.css' type='text/css'/>
<script src='../editor/jquery.js'></script>
<script src='../editor/svgedit.js'></script>
<script src='../editor/units.js'></script>
<script src='qunit/qunit.js'></script>
<script>
$(function() {
// log function
QUnit.log = function(result, message) {
if (window.console && window.console.log) {
@ -86,17 +87,15 @@ $(function() {
equals(svgedit.units.convertUnit(42), 1.1113);
equals(svgedit.units.convertUnit(42, 'px'), 42);
});
});
</script>
});
</script>
</head>
<body>
<h1 id='qunit-header'>Unit Tests for units.js</h1>
<h2 id='qunit-banner'></h2>
<h2 id='qunit-userAgent'></h2>
<ol id='qunit-tests'>
</ol>
<div id='anchor' style='visibility:hidden'>
</div>
<ol id='qunit-tests'></ol>
<div id='anchor' style='visibility:hidden'></div>
<div id="elementsContainer">
<div id='uniqueId' style='visibility:hidden'></div>
<div id='nonUniqueId' style='visibility:hidden'></div>