This commit is contained in:
Jovination
2015-01-27 00:07:51 -07:00
parent b585ba4daf
commit 607ef1837b
130 changed files with 5722 additions and 5713 deletions

View File

@@ -1,21 +1,21 @@
suite('Global', function() {
// ======================================================
test('test Kinetic version number', function() {
assert.equal(Kinetic.version, 'dev');
test('test Konva version number', function() {
assert.equal(Konva.version, 'dev');
});
// ======================================================
test('getAngle()', function() {
// test that default angleDeg is true
assert.equal(Kinetic.angleDeg, true);
assert.equal(Kinetic.getAngle(180), Math.PI);
assert.equal(Konva.angleDeg, true);
assert.equal(Konva.getAngle(180), Math.PI);
Kinetic.angleDeg = false;
assert.equal(Kinetic.getAngle(1), 1);
Konva.angleDeg = false;
assert.equal(Konva.getAngle(1), 1);
// set angleDeg back to true for future tests
Kinetic.angleDeg = true;
Konva.angleDeg = true;
});
@@ -25,7 +25,7 @@ suite('Global', function() {
var ua;
// Chrome 34.0.1847.137 m
ua = Kinetic._parseUA('Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.137 Safari/537.36');
ua = Konva._parseUA('Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.137 Safari/537.36');
assert.equal(ua.browser, 'chrome');
assert.equal(ua.mobile, false);
@@ -34,42 +34,42 @@ suite('Global', function() {
// Internet Explorer 9
ua = Kinetic._parseUA('Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)');
ua = Konva._parseUA('Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)');
assert.equal(ua.browser, 'msie');
assert.equal(ua.mobile, false);
assert.equal(ua.version, '9.0');
assert.equal(ua.ieMobile, false);
// Internet Explorer 10
ua = Kinetic._parseUA('Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)');
ua = Konva._parseUA('Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)');
assert.equal(ua.browser, 'msie');
assert.equal(ua.mobile, false);
assert.equal(ua.version, '10.0');
assert.equal(ua.ieMobile, false);
// Internet Explorer 10 Mobile (Windows Phone 8)
ua = Kinetic._parseUA('Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 920)');
ua = Konva._parseUA('Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 920)');
assert.equal(ua.browser, 'msie');
assert.equal(ua.mobile, true);
assert.equal(ua.version, '10.0');
assert.equal(ua.ieMobile, true); // <-- forces Kinetic mouse events to be Kinetic touch events instead
assert.equal(ua.ieMobile, true); // <-- forces Konva mouse events to be Konva touch events instead
// Internet Explorer 11 Mobile (Windows Phone 8.1)
ua = Kinetic._parseUA('Mozilla/5.0 (Windows Phone 8.1; ARM; Trident/7.0; Touch; rv:11; IEMobile/11.0; NOKIA; Lumia 928) like Gecko');
ua = Konva._parseUA('Mozilla/5.0 (Windows Phone 8.1; ARM; Trident/7.0; Touch; rv:11; IEMobile/11.0; NOKIA; Lumia 928) like Gecko');
assert.equal(ua.browser, 'mozilla');
assert.equal(ua.mobile, true);
assert.equal(ua.version, '11');
assert.equal(ua.ieMobile, true); // <-- forces Kinetic mouse events to be Kinetic touch events instead
assert.equal(ua.ieMobile, true); // <-- forces Konva mouse events to be Konva touch events instead
// Internet Explorer 11 on 64-bit Windows 8.1 with Update
ua = Kinetic._parseUA('Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko');
ua = Konva._parseUA('Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko');
assert.equal(ua.browser, 'mozilla');
assert.equal(ua.mobile, false);
assert.equal(ua.version, '11.0');
assert.equal(ua.ieMobile, false);
// Windows 8.1 with Update HTML/JS appx
ua = Kinetic._parseUA('Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729; Tablet PC 2.0; MSAppHost/2.0; rv:11.0) like Gecko');
ua = Konva._parseUA('Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729; Tablet PC 2.0; MSAppHost/2.0; rv:11.0) like Gecko');
assert.equal(ua.browser, 'mozilla');
assert.equal(ua.mobile, false);
assert.equal(ua.version, '11.0');