summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSolly Ross <sross@redhat.com>2015-08-24 19:30:44 -0400
committerSolly Ross <sross@redhat.com>2015-08-24 19:30:44 -0400
commitbb180145c654c4bc1ab9eca15a7acaa494d9fa50 (patch)
treeda258286ddc40c0d33db32045655ff5c0712be74
parent340290fa1d6a53d30a38b6604bcacef5940c4c52 (diff)
downloadnovnc-bb180145c654c4bc1ab9eca15a7acaa494d9fa50.tar.gz
Tests: Fixed bug in displayed assertion
This `displayed` assertion had a bug that was causing it to not actually check anything (it was using obj.length instead of data_cl.length). This fixes that.
-rw-r--r--tests/assertions.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/assertions.js b/tests/assertions.js
index 930e146..4bd0cf4 100644
--- a/tests/assertions.js
+++ b/tests/assertions.js
@@ -6,10 +6,15 @@ chai.use(function (_chai, utils) {
// NB(directxman12): PhantomJS 1.x doesn't implement Uint8ClampedArray, so work around that
var data = new Uint8Array(data_cl);
var same = true;
- for (var i = 0; i < obj.length; i++) {
- if (data[i] != target_data[i]) {
- same = false;
- break;
+ var len = data_cl.length;
+ if (len != target_data.length) {
+ same = false;
+ } else {
+ for (var i = 0; i < len; i++) {
+ if (data[i] != target_data[i]) {
+ same = false;
+ break;
+ }
}
}
if (!same) {