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.
This commit is contained in:
Solly Ross 2015-08-24 19:30:44 -04:00
parent 6901a940e7
commit ae660d756c
1 changed files with 9 additions and 4 deletions

View File

@ -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) {