diff options
author | Solly Ross <sross@redhat.com> | 2014-09-19 12:16:06 -0400 |
---|---|---|
committer | Solly Ross <sross@redhat.com> | 2014-09-19 12:16:06 -0400 |
commit | 2c9623b5a73e5ab9b54d462596d1fef0063c9a73 (patch) | |
tree | ab2798c1ad05ef78a048e89b734dbec139125bf6 /tests/test.display.js | |
parent | f8f95d6023c21c050d37c4e0b1313b70655209c0 (diff) | |
download | novnc-2c9623b5a73e5ab9b54d462596d1fef0063c9a73.tar.gz |
Fixed assertion collision issues
When run via karma, all the tests are loaded into the same page.
This was causing a collision in the 'displayed' assertion dealing
with using viewportLoc.
The assertions are now in their own file, pulled in by tests that
need them. Additionally, several tests which only set fb_width
and fb_height were correct to set viewportLoc as well.
Closes #392
Also-Authored-By: Martin André (github: mandre)
Diffstat (limited to 'tests/test.display.js')
-rw-r--r-- | tests/test.display.js | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/tests/test.display.js b/tests/test.display.js index c4535a0..832970d 100644 --- a/tests/test.display.js +++ b/tests/test.display.js @@ -1,21 +1,8 @@ // requires local modules: util, base64, display +// requires test modules: assertions /* jshint expr: true */ var expect = chai.expect; -chai.use(function (_chai, utils) { - _chai.Assertion.addMethod('displayed', function (target_data) { - var obj = this._obj; - var data_cl = obj._drawCtx.getImageData(0, 0, obj._viewportLoc.w, obj._viewportLoc.h).data; - // NB(directxman12): PhantomJS 1.x doesn't implement Uint8ClampedArray, so work around that - var data = new Uint8Array(data_cl); - this.assert(utils.eql(data, target_data), - "expected #{this} to have displayed the image #{exp}, but instead it displayed #{act}", - "expected #{this} not to have displayed the image #{act}", - target_data, - data); - }); -}); - describe('Display/Canvas Helper', function () { var checked_data = [ 0x00, 0x00, 0xff, 255, 0x00, 0x00, 0xff, 255, 0x00, 0xff, 0x00, 255, 0x00, 0xff, 0x00, 255, |