Correct mime type on svgutils_test.html. Add test for svgedit.utilities.bboxToObj()
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1859 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
@@ -16,6 +16,9 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var svgns = 'http://www.w3.org/2000/svg';
|
||||||
|
var svg = document.createElementNS(svgns, 'svg');
|
||||||
|
|
||||||
module('svgedit.utilities Module');
|
module('svgedit.utilities Module');
|
||||||
|
|
||||||
test('Test svgedit.utilities package', function() {
|
test('Test svgedit.utilities package', function() {
|
||||||
@@ -70,6 +73,24 @@
|
|||||||
equals(decode64('YH4hQCMkJV4mKigpLV89K1t7XX1cfDs6JyIsPC4+Lz8='), '`~!@#$%^&*()-_=+[{]}\\|;:\'",<.>/?');
|
equals(decode64('YH4hQCMkJV4mKigpLV89K1t7XX1cfDs6JyIsPC4+Lz8='), '`~!@#$%^&*()-_=+[{]}\\|;:\'",<.>/?');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('Test svgedit.utilities.bboxToObj() function', function() {
|
||||||
|
expect(5);
|
||||||
|
var bboxToObj = svgedit.utilities.bboxToObj;
|
||||||
|
|
||||||
|
var rect = svg.createSVGRect();
|
||||||
|
rect.x = 1;
|
||||||
|
rect.y = 2;
|
||||||
|
rect.width = 3;
|
||||||
|
rect.height = 4;
|
||||||
|
|
||||||
|
var obj = bboxToObj(rect);
|
||||||
|
equals(typeof obj, typeof {});
|
||||||
|
equals(obj.x, 1);
|
||||||
|
equals(obj.y, 2);
|
||||||
|
equals(obj.width, 3);
|
||||||
|
equals(obj.height, 4);
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -241,15 +241,6 @@
|
|||||||
equal(math.namespaceURI, "http://www.w3.org/1998/Math/MathML", "Preserved MathML namespace");
|
equal(math.namespaceURI, "http://www.w3.org/1998/Math/MathML", "Preserved MathML namespace");
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Test escaping XML entities", function() {
|
|
||||||
expect(3);
|
|
||||||
|
|
||||||
equal(svgCanvas.Utils.toXml("<"), "<", "Escaped < properly");
|
|
||||||
equal(svgCanvas.Utils.toXml(">"), ">", "Escaped > properly");
|
|
||||||
equal(svgCanvas.Utils.toXml("&"), "&", "Escaped & properly");
|
|
||||||
// TODO: what about " and ' ?
|
|
||||||
});
|
|
||||||
|
|
||||||
test("Test importing SVG into existing drawing", function() {
|
test("Test importing SVG into existing drawing", function() {
|
||||||
expect(3);
|
expect(3);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user