Upgrade to ExtJS 4.0.2 - Released 06/09/2011
[extjs.git] / src / core / test / unit / spec / Ext-more.js
index 38d508b..3f09150 100644 (file)
@@ -1,3 +1,17 @@
+/*
+
+This file is part of Ext JS 4
+
+Copyright (c) 2011 Sencha Inc
+
+Contact:  http://www.sencha.com/contact
+
+GNU General Public License Usage
+This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file.  Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
+
+If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
+
+*/
 describe("Ext-more", function() {
     describe("Ext.id", function(){
         var el;
@@ -65,16 +79,17 @@ describe("Ext-more", function() {
             cmp.destroy();
         });
     });
-
-    describe("Ext.getOrientation", function() {
-        it("should return the current orientation of the mobile device", function() {
-            if (window.innerHeight <= window.innerWidth) {
-                expect(Ext.getOrientation()).toEqual("landscape");
-            } else {
-                expect(Ext.getOrientation()).toEqual("portrait");
-            }
+    if (!Ext.isWindows && !Ext.isMac && !Ext.isLinux) {
+        describe("Ext.getOrientation", function() {
+            it("should return the current orientation of the mobile device", function() {
+                if (window.innerHeight <= window.innerWidth) {
+                    expect(Ext.getOrientation()).toEqual("landscape");
+                } else {
+                    expect(Ext.getOrientation()).toEqual("portrait");
+                }
+            });
         });
-    });
+    }
 
     describe("Ext.callback", function() {
         var cfn;
@@ -275,14 +290,16 @@ describe("Ext-more", function() {
                 Ext.removeNode(el.dom);
                 expect(Ext.cache[id]).toBeUndefined();
             });
+            if (!Ext.isIE6 && !Ext.isIE7) {
+                it("should remove all listeners from the dom element", function() {
+                        var listener = jasmine.createSpy();
+                        el.on('mouseup', listener);
+                        Ext.removeNode(el.dom);
+                        jasmine.fireMouseEvent(el.dom, 'mouseup');
+                        expect(listener).not.toHaveBeenCalled();
 
-            it("should remove all listeners from the dom element", function() {
-                var listener = jasmine.createSpy();
-                el.on('mouseup', listener);
-                Ext.removeNode(el.dom);
-                jasmine.fireMouseEvent(el.dom, 'mouseup');
-                expect(listener).not.toHaveBeenCalled();
-            });
+                });
+            }
         });
 
         describe("if passed element is body", function() {
@@ -300,47 +317,51 @@ describe("Ext-more", function() {
                 Ext.getBody().un('mouseup', listener);
             });
         });
+        
+        if (!Ext.isIE6 && !Ext.isIE7) {
+            describe("if enableNestedListenerRemoval is true", function() {
+                var el, child;
+
+                beforeEach(function(){
+                    Ext.enableNestedListenerRemoval = true;
+                    el = Ext.getBody().createChild();
+                    child = el.createChild();
+                });
 
-        describe("if enableNestedListenerRemoval is true", function() {
-            var el, child;
-
-            beforeEach(function(){
-                Ext.enableNestedListenerRemoval = true;
-                el = Ext.getBody().createChild();
-                child = el.createChild();
-            });
-
-            afterEach(function(){
-                Ext.enableNestedListenerRemoval = false;
-            });
+                afterEach(function(){
+                    Ext.enableNestedListenerRemoval = false;
+                });
 
-            it("should remove listener on children", function() {
-                var listener = jasmine.createSpy();
-                child.on('mouseup', listener); 
-                Ext.removeNode(el.dom);
-                jasmine.fireMouseEvent(child.dom, 'mouseup');
-                expect(listener).not.toHaveBeenCalled();
-            });
+                    it("should remove listener on children", function() {
+                        var listener = jasmine.createSpy();
+                        child.on('mouseup', listener); 
+                        Ext.removeNode(el.dom);
+                        jasmine.fireMouseEvent(child.dom, 'mouseup');
+                        expect(listener).not.toHaveBeenCalled();
+                    });
 
-        });
 
-        describe("if enableNestedListenerRemoval is false (default)", function() {
-            var el, child;
-
-            beforeEach(function(){
-                el = Ext.getBody().createChild();
-                child = el.createChild();
             });
+        }
+        if (!Ext.isIE6 && !Ext.isIE7) {
+            describe("if enableNestedListenerRemoval is false (default)", function() {
+                var el, child;
+
+                beforeEach(function(){
+                    el = Ext.getBody().createChild();
+                    child = el.createChild();
+                });
 
-            it("should not remove listener on children", function() {
-                var listener = jasmine.createSpy();
-                child.on('mouseup', listener); 
-                Ext.removeNode(el.dom);
-                jasmine.fireMouseEvent(child.dom, 'mouseup');
-                expect(listener).toHaveBeenCalled();
-                Ext.EventManager.purgeElement(child.dom);
+                it("should not remove listener on children", function() {
+                    var listener = jasmine.createSpy();
+                    child.on('mouseup', listener); 
+                    Ext.removeNode(el.dom);
+                    jasmine.fireMouseEvent(child.dom, 'mouseup');
+                    expect(listener).toHaveBeenCalled();
+                    Ext.EventManager.purgeElement(child.dom);
+                });
             });
-        });
+        }
     });
 
     describe("Ext.addBehaviors", function() {
@@ -491,7 +512,7 @@ describe("Ext-more", function() {
                     'a'
                 ];
                  expect(Ext.partition(array, function(item){
-                        return item == "a"
+                        return item == "a";
                 })).toEqual([
                     ['a', 'a'], 
                     ['b', 'c']
@@ -529,7 +550,7 @@ describe("Ext-more", function() {
                 });                    
                 
                 expect(Ext.partition(Ext.query("p"), function(val){
-                        return val.className == "class1"
+                        return val.className == "class1";
                 })).toEqual([
                     [p[0].dom, p[2].dom, p[5].dom], 
                     [p[1].dom, p[3].dom, p[4].dom]
@@ -542,3 +563,4 @@ describe("Ext-more", function() {
         });
     });
 });
+