summaryrefslogtreecommitdiff
path: root/tests/test.keyboard.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test.keyboard.js')
-rw-r--r--tests/test.keyboard.js49
1 files changed, 5 insertions, 44 deletions
diff --git a/tests/test.keyboard.js b/tests/test.keyboard.js
index 6b59cde..0d8cac6 100644
--- a/tests/test.keyboard.js
+++ b/tests/test.keyboard.js
@@ -144,18 +144,10 @@ describe('Key Event Handling', function () {
origNavigator = Object.getOwnPropertyDescriptor(window, "navigator");
Object.defineProperty(window, "navigator", {value: {}});
- if (window.navigator.platform !== undefined) {
- // Object.defineProperty() doesn't work properly in old
- // versions of Chrome
- this.skip();
- }
-
window.navigator.platform = "Mac x86_64";
});
afterEach(function () {
- if (origNavigator !== undefined) {
- Object.defineProperty(window, "navigator", origNavigator);
- }
+ Object.defineProperty(window, "navigator", origNavigator);
});
it('should change Alt to AltGraph', function () {
@@ -267,17 +259,10 @@ describe('Key Event Handling', function () {
origNavigator = Object.getOwnPropertyDescriptor(window, "navigator");
Object.defineProperty(window, "navigator", {value: {}});
- if (window.navigator.platform !== undefined) {
- // Object.defineProperty() doesn't work properly in old
- // versions of Chrome
- this.skip();
- }
});
afterEach(function () {
- if (origNavigator !== undefined) {
- Object.defineProperty(window, "navigator", origNavigator);
- }
+ Object.defineProperty(window, "navigator", origNavigator);
});
it('should toggle caps lock on key press on iOS', function () {
@@ -334,19 +319,11 @@ describe('Key Event Handling', function () {
origNavigator = Object.getOwnPropertyDescriptor(window, "navigator");
Object.defineProperty(window, "navigator", {value: {}});
- if (window.navigator.platform !== undefined) {
- // Object.defineProperty() doesn't work properly in old
- // versions of Chrome
- this.skip();
- }
-
window.navigator.platform = "Windows";
});
afterEach(function () {
- if (origNavigator !== undefined) {
- Object.defineProperty(window, "navigator", origNavigator);
- }
+ Object.defineProperty(window, "navigator", origNavigator);
});
const keys = { 'Zenkaku': 0xff2a, 'Hankaku': 0xff2a,
@@ -375,20 +352,12 @@ describe('Key Event Handling', function () {
origNavigator = Object.getOwnPropertyDescriptor(window, "navigator");
Object.defineProperty(window, "navigator", {value: {}});
- if (window.navigator.platform !== undefined) {
- // Object.defineProperty() doesn't work properly in old
- // versions of Chrome
- this.skip();
- }
-
window.navigator.platform = "Windows x86_64";
this.clock = sinon.useFakeTimers();
});
afterEach(function () {
- if (origNavigator !== undefined) {
- Object.defineProperty(window, "navigator", origNavigator);
- }
+ Object.defineProperty(window, "navigator", origNavigator);
if (this.clock !== undefined) {
this.clock.restore();
}
@@ -520,20 +489,12 @@ describe('Key Event Handling', function () {
origNavigator = Object.getOwnPropertyDescriptor(window, "navigator");
Object.defineProperty(window, "navigator", {value: {}});
- if (window.navigator.platform !== undefined) {
- // Object.defineProperty() doesn't work properly in old
- // versions of Chrome
- this.skip();
- }
-
window.navigator.platform = "Windows x86_64";
this.clock = sinon.useFakeTimers();
});
afterEach(function () {
- if (origNavigator !== undefined) {
- Object.defineProperty(window, "navigator", origNavigator);
- }
+ Object.defineProperty(window, "navigator", origNavigator);
if (this.clock !== undefined) {
this.clock.restore();
}