This commit is contained in:
Alan Kligman 2014-02-19 12:53:05 -05:00
parent ebe52fe5c3
commit 3d57be4858
2 changed files with 20 additions and 2 deletions

View File

@ -79,6 +79,23 @@ function(Filer, IndexedDBTestProvider, WebSQLTestProvider, MemoryTestProvider) {
}); });
} }
function typedArrayEqual(a, b) {
if(!(a && b)) {
return false;
}
if(a.length !== b.length) {
return false;
}
for(var i = 0; i < a.length; ++ i) {
if(a[i] !== b[i]) {
return false;
}
}
return true;
}
return { return {
uniqueName: uniqueName, uniqueName: uniqueName,
setup: setup, setup: setup,
@ -89,7 +106,8 @@ function(Filer, IndexedDBTestProvider, WebSQLTestProvider, MemoryTestProvider) {
WebSQL: WebSQLTestProvider, WebSQL: WebSQLTestProvider,
Memory: MemoryTestProvider Memory: MemoryTestProvider
}, },
cleanup: cleanup cleanup: cleanup,
typedArrayEqual: typedArrayEqual
}; };
}); });

View File

@ -67,7 +67,7 @@ define(["Filer", "util"], function(Filer, util) {
context.get("key", function(error, result) { context.get("key", function(error, result) {
expect(error).not.to.exist; expect(error).not.to.exist;
expect(result).to.deep.equal(valueBuffer); expect(util.typedArrayEqual(result, valueBuffer)).to.be.true;
done(); done();
}); });
}); });