mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1387303 - fix test_places_guid_downgrade.js to work correctly in the new async-sync world. r=eoger
MozReview-Commit-ID: 4bmu45qUmFA
This commit is contained in:
parent
b56bbf2305
commit
4f08809c1f
@ -109,17 +109,10 @@ add_task(async function test_history_guids() {
|
||||
}]
|
||||
}
|
||||
];
|
||||
PlacesUtils.asyncHistory.updatePlaces(places, {
|
||||
handleError: function handleError() {
|
||||
do_throw("Unexpected error in adding visit.");
|
||||
},
|
||||
handleResult: function handleResult() {},
|
||||
handleCompletion: onVisitAdded
|
||||
});
|
||||
|
||||
function onVisitAdded() {
|
||||
let fxguid = store.GUIDForUri(fxuri, true);
|
||||
let tbguid = store.GUIDForUri(tburi, true);
|
||||
async function onVisitAdded() {
|
||||
let fxguid = await store.GUIDForUri(fxuri, true);
|
||||
let tbguid = await store.GUIDForUri(tburi, true);
|
||||
dump("fxguid: " + fxguid + "\n");
|
||||
dump("tbguid: " + tbguid + "\n");
|
||||
|
||||
@ -151,9 +144,17 @@ add_task(async function test_history_guids() {
|
||||
result = Async.querySpinningly(stmt, ["guid"]);
|
||||
do_check_eq(result.length, 0);
|
||||
stmt.finalize();
|
||||
|
||||
run_next_test();
|
||||
}
|
||||
|
||||
await new Promise((resolve, reject) => {
|
||||
PlacesUtils.asyncHistory.updatePlaces(places, {
|
||||
handleError: function handleError() {
|
||||
do_throw("Unexpected error in adding visit.");
|
||||
},
|
||||
handleResult: function handleResult() {},
|
||||
handleCompletion: () => { onVisitAdded().then(resolve, reject) },
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
add_task(async function test_bookmark_guids() {
|
||||
|
Loading…
Reference in New Issue
Block a user