Move Selector and SelectorManager into select.js. Start of unit test file for select.js.

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1873 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
Jeff Schiller
2010-11-15 09:25:49 +00:00
parent 383d52e157
commit 3ef0229180
11 changed files with 781 additions and 638 deletions

View File

@@ -18,6 +18,6 @@ window.setTimeout(function() {
var f = iframes[i];
f.style.height = (f.contentDocument.body.scrollHeight + 20) + 'px';
}
}, 1000);
}, 1200);
</script>
</html>

View File

@@ -7,6 +7,7 @@
<script type='text/javascript' src='qunit/qunit.js'></script>
<script type='text/javascript'>
$(function() {
// TODO(codedread): Write tests for handling history events.
// Mocked out methods.
svgedit.transformlist = {};
@@ -547,6 +548,8 @@
batch.unapply();
equals(concatResult, 'cba');
MockCommand.prototype.unapply = function() {};
tearDown();
});

View File

@@ -1,10 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<link rel='stylesheet' href='qunit/qunit.css' type='text/css'/>
<html>
<head>
<link rel='stylesheet' href='qunit/qunit.css' type='text/css'/>
<script src='../editor/jquery.js'></script>
<script type='text/javascript' src='../editor/math.js'></script>
<script type='text/javascript' src='qunit/qunit.js'></script>
<script type='text/javascript' src='qunit/qunit.js'></script>
<script type='text/javascript'>
$(function() {
// log function

44
test/select_test.html Normal file
View File

@@ -0,0 +1,44 @@
<!DOCTYPE html>
<html>
<head>
<link rel='stylesheet' href='qunit/qunit.css' type='text/css'/>
<script src='../editor/jquery.js'></script>
<script type='text/javascript' src='../editor/select.js'></script>
<script type='text/javascript' src='qunit/qunit.js'></script>
<script type='text/javascript'>
$(function() {
// log function
QUnit.log = function(result, message) {
if (window.console && window.console.log) {
window.console.log(result +' :: '+ message);
}
};
module('svgedit.select');
test('Test svgedit.select package', function() {
expect(10);
ok(svgedit.select);
ok(svgedit.select.Selector);
ok(svgedit.select.SelectorManager);
ok(svgedit.select.init);
ok(svgedit.select.getSelectorManager);
equals(typeof svgedit.select, typeof {});
equals(typeof svgedit.select.Selector, typeof function(){});
equals(typeof svgedit.select.SelectorManager, typeof function(){});
equals(typeof svgedit.select.init, typeof function(){});
equals(typeof svgedit.select.getSelectorManager, typeof function(){});
});
});
</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>
</body>
</html>

View File

@@ -12,6 +12,7 @@
<script type="text/javascript" src="../editor/svgutils.js"></script>
<script type="text/javascript" src="../editor/sanitize.js"></script>
<script type="text/javascript" src="../editor/history.js"></script>
<script type="text/javascript" src="../editor/select.js"></script>
<script type="text/javascript" src="../editor/svgcanvas.js"></script>
<script type="text/javascript" src="qunit/qunit.js"></script>
<script type="text/javascript">