mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Bug 1159310 - Update the storage xpcshell tests. r=dougt
--HG-- extra : rebase_source : 3a49ed7f897c4edda9a2b84e4bd9f5f31777d3e2
This commit is contained in:
parent
9bf4add3ed
commit
fb8ad5dbce
@ -105,5 +105,19 @@ add_task(function* test_notification_incomplete() {
|
||||
let storeRecords = yield promiseDB.getAllChannelIDs();
|
||||
storeRecords.sort(({pushEndpoint: a}, {pushEndpoint: b}) =>
|
||||
compareAscending(a, b));
|
||||
deepEqual(records, storeRecords, 'Should not update malformed records');
|
||||
recordsAreEqual(records, storeRecords);
|
||||
});
|
||||
|
||||
function recordIsEqual(a, b) {
|
||||
strictEqual(a.channelID, b.channelID, 'Wrong channel ID in record');
|
||||
strictEqual(a.pushEndpoint, b.pushEndpoint, 'Wrong push endpoint in record');
|
||||
strictEqual(a.scope, b.scope, 'Wrong scope in record');
|
||||
strictEqual(a.version, b.version, 'Wrong version in record');
|
||||
}
|
||||
|
||||
function recordsAreEqual(a, b) {
|
||||
equal(a.length, b.length, 'Mismatched record count');
|
||||
for (let i = 0; i < a.length; i++) {
|
||||
recordIsEqual(a[i], b[i]);
|
||||
}
|
||||
}
|
||||
|
@ -60,8 +60,10 @@ add_task(function* test_registration_success() {
|
||||
|
||||
let registration = yield PushNotificationService.registration(
|
||||
'https://example.net/a');
|
||||
deepEqual(registration, {
|
||||
pushEndpoint: 'https://example.com/update/same-manifest/1',
|
||||
version: 5
|
||||
}, 'Should include registrations for all pages with this manifest');
|
||||
equal(
|
||||
registration.pushEndpoint,
|
||||
'https://example.com/update/same-manifest/1',
|
||||
'Wrong push endpoint for scope'
|
||||
);
|
||||
equal(registration.version, 5, 'Wrong version for scope');
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user