diff options
author | Solly Ross <sross@redhat.com> | 2018-01-10 11:08:21 -0500 |
---|---|---|
committer | Solly Ross <sross@redhat.com> | 2018-01-10 11:08:21 -0500 |
commit | af4deba893faabfdf804cb139e43dfb7125c4303 (patch) | |
tree | a889a2c41bb93f11ab347aff691108c7150e465e | |
parent | 37c609359ab3606cba2b233611adce029a84ac01 (diff) | |
download | novnc-bug/ie11-tests-slice.tar.gz |
Fix slice usage in display tests on IE11bug/ie11-tests-slice
IE11 doesn't support the `slice` method on ArrayBufferViews, so
we have to use the old `Array.prototype.slice.call` trick in the
tests instead.
-rw-r--r-- | tests/test.display.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/test.display.js b/tests/test.display.js index 60201ed..2e8f90e 100644 --- a/tests/test.display.js +++ b/tests/test.display.js @@ -354,7 +354,8 @@ describe('Display/Canvas Helper', function () { for (let x = 0;x < 16;x++) { let pixel; if ((x < 4) && (y < 4)) { - pixel = checked_data.slice((y*4+x)*4, (y*4+x+1)*4); + // NB: of course IE11 doesn't support #slice on ArrayBufferViews... + pixel = Array.prototype.slice.call(checked_data, (y*4+x)*4, (y*4+x+1)*4); } else { pixel = [0, 0xff, 0, 255]; } |