diff options
author | Pierre Ossman <ossman@cendio.se> | 2016-11-29 16:06:20 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2016-11-29 17:00:24 +0100 |
commit | 6ec3af22ca952c5e7a5240da39d178fd995dfd5a (patch) | |
tree | f3724be117781ae64108495c0a97029c691f5bd6 | |
parent | acca6487f2eaef58b2829c31cbee14c25ca7747c (diff) | |
download | novnc-6ec3af22ca952c5e7a5240da39d178fd995dfd5a.tar.gz |
Skip language tests on broken browsers
The hacks needed to run these tests require proper handling of
properties. Unfortunately IE and old versions of Chrome mess up,
so just skip the tests there.
-rw-r--r-- | tests/test.util.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test.util.js b/tests/test.util.js index bce475d..60cdb58 100644 --- a/tests/test.util.js +++ b/tests/test.util.js @@ -63,7 +63,19 @@ describe('Utils', function() { // environments, so we need to redefine it whilst running these // tests. origNavigator = Object.getOwnPropertyDescriptor(window, "navigator"); + if (origNavigator === undefined) { + // Object.getOwnPropertyDescriptor() doesn't work + // properly in any version of IE + this.skip(); + } + Object.defineProperty(window, "navigator", {value: {}}); + if (window.navigator.languages !== undefined) { + // Object.defineProperty() doesn't work properly in old + // versions of Chrome + this.skip(); + } + window.navigator.languages = []; }); afterEach(function () { |