Index: third_party/WebKit/LayoutTests/storage/indexeddb/resources/generic-idb-operations.js |
diff --git a/third_party/WebKit/LayoutTests/storage/indexeddb/resources/generic-idb-operations.js b/third_party/WebKit/LayoutTests/storage/indexeddb/resources/generic-idb-operations.js |
index e1974e111b82546ae6342ff979148e820aa12ead..2b55f6865e4327ee18c06bd1e7501b4812d0a3bc 100644 |
--- a/third_party/WebKit/LayoutTests/storage/indexeddb/resources/generic-idb-operations.js |
+++ b/third_party/WebKit/LayoutTests/storage/indexeddb/resources/generic-idb-operations.js |
@@ -7,9 +7,10 @@ function compareChanges(actual, expected) { |
var stores = Object.keys(expected.records); |
assert_equals(actual.records.size, stores.length, 'Incorrect number of objectStores recorded by observer'); |
+ var storesStr = Array.from(actual.records.keys()).join(", "); |
pwnall
2017/01/10 01:41:11
storeNamesString?
dmurph
2017/01/10 20:40:02
Done.
|
for (var i in stores) { |
var key = stores[i]; |
- assert_true(actual.records.has(key)); |
+ assert_true(actual.records.has(key), "Store '" + key + "' not found in changes. Stores: " + storesStr); |
var actual_obsv = actual.records.get(key); |
pwnall
2017/01/10 01:41:11
camelCase instead of snake_case?
dmurph
2017/01/10 20:40:05
Done.
|
var expected_obsv = expected.records[key]; |
assert_equals(actual_obsv.length, expected_obsv.length, 'Number of observations recorded for objectStore '+ key + ' should match observed operations'); |
@@ -37,8 +38,12 @@ function compareObservations(actual, expected) { |
} |
assert_equals(actual.key.lower, expected.key, 'Observed operation key lower bound should match operation performed'); |
pwnall
2017/01/10 01:41:11
There doesn't seem to be any checking for add vs p
dmurph
2017/01/10 20:40:05
That's basically done above, in the assert_equals(
|
assert_equals(actual.key.upper, expected.key, 'Observed operation key upper bound should match operation performed'); |
- // TODO(dmurph): Value needs to be updated, once returned correctly. Issue crbug.com/609934. |
- assert_equals(actual.value, null, 'Put/Add operation value does not match'); |
+ if (expected.value != undefined) { |
+ assert_equals(actual.value, expected.value, 'Put/Add operation value does not match'); |
+ } else { |
+ // TODO(dmurph): Value needs to be updated, once returned correctly. Issue crbug.com/609934. |
+ assert_equals(actual.value, null, 'Put/Add operation has unexpected value'); |
+ } |
} |
function countCallbacks(actual, expected) { |