mirror of
https://github.com/novnc/noVNC.git
synced 2026-05-26 07:08:06 +00:00
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.
This commit is contained in:
@@ -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 () {
|
||||
|
||||
Reference in New Issue
Block a user