// Screen Orientation API testing is problematic in that not every platform
// supports orientation-locking, and locking requires running in full-screen.
// So for now, only negative/sanity testing is done here, as that works globally.
function unexpectedEvent(event) {
ok(false, "No unexpected orientation change events received");
}
// Negative tests
ok(!window.screen.mozLockOrientation("Foobar-Bazbam"), "Cannot lock to an invalid string");
is(window.screen.mozOrientation, initialOrientation, "Orientation is unchanged");
ok(!window.screen.mozLockOrientation(""), "Cannot lock to an empty string");
is(window.screen.mozOrientation, initialOrientation, "Orientation is unchanged");
ok(!window.screen.mozLockOrientation(["Foobar", "Bazbam"]), "Cannot lock to an invalid string");
is(window.screen.mozOrientation, initialOrientation, "Orientation is unchanged");
ok(!window.screen.mozLockOrientation(["foo"]), "Cannot lock to an invalid string");
is(window.screen.mozOrientation, initialOrientation, "Orientation is unchanged");
ok(!window.screen.mozLockOrientation([""]), "Cannot lock to an empty string");
is(window.screen.mozOrientation, initialOrientation, "Orientation is unchanged");
ok(!window.screen.mozLockOrientation(42), "Cannot lock to a number");
is(window.screen.mozOrientation, initialOrientation, "Orientation is unchanged");
ok(!window.screen.mozLockOrientation(undefined), "Cannot lock to undefined");
is(window.screen.mozOrientation, initialOrientation, "Orientation is unchanged");
ok(!window.screen.mozLockOrientation(null), "Cannot lock to null");
is(window.screen.mozOrientation, initialOrientation, "Orientation is unchanged");
ok(!window.screen.mozLockOrientation({}), "Cannot lock to a non-Array object");
is(window.screen.mozOrientation, initialOrientation, "Orientation is unchanged");
ok(!window.screen.mozLockOrientation(["Foobar", 42]), "Cannot lock to a number");
is(window.screen.mozOrientation, initialOrientation, "Orientation is unchanged");
ok(!window.screen.mozLockOrientation(["Foobar", null]), "Cannot lock to null");
is(window.screen.mozOrientation, initialOrientation, "Orientation is unchanged");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.