mirror of
https://github.com/apache/cordova-plugin-screen-orientation.git
synced 2026-04-23 00:00:14 +08:00
working version of screen orientation plugin adhering to w3c specs
This commit is contained in:
@@ -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();
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user