working version of screen orientation plugin adhering to w3c specs

This commit is contained in:
maverickmishra
2017-01-09 16:42:53 -08:00
parent 912b6b199b
commit 1f536ec80e
4 changed files with 127 additions and 107 deletions
+34
View File
@@ -56,4 +56,38 @@ exports.defineAutoTests = function() {
}
});
});
describe('OrientationLockType should have one of seven values', function () {
it("should have one of seven orientation lock types", function(){
expect(window.OrientationLockType['portrait-primary']).toBe(1);
expect(window.OrientationLockType['portrait-secondary']).toBe(2);
expect(window.OrientationLockType['landscape-primary']).toBe(4);
expect(window.OrientationLockType['landscape-secondary']).toBe(8);
expect(window.OrientationLockType['portrait']).toBe(3);
expect(window.OrientationLockType['landscape']).toBe(12);
expect(window.OrientationLockType['any']).toBe(15);
alert(window.screen.orientation.angle);
});
});
describe('Screen object should exist', function () {
it("should exist", function() {
expect(window.screen).toBeDefined();
});
it(" screen should contain an attribute called ScreenOrientation", function() {
expect(window.screen.orientation).toBeDefined();
});
it(" Screenorientation object should contain methods called lock and unlock", function() {
expect(window.screen.orientation.lock).toEqual(jasmine.any(Function));
expect(window.screen.orientation.unlock).toEqual(jasmine.any(Function));
});
it(" Screenorientation object should contain properties called type and angle", function() {
expect(window.screen.orientation.type).toBeDefined();
expect(window.screen.orientation.angle).toBeDefined();
});
});
};