mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1010255 - Fixing uncaught promise error in test_bookmarks_restore_notification.js. r=mak
This commit is contained in:
parent
8552b7733b
commit
a2bfabb74b
@ -179,9 +179,9 @@ this.BookmarkHTMLUtils = Object.freeze({
|
||||
return Task.spawn(function* () {
|
||||
notifyObservers(PlacesUtils.TOPIC_BOOKMARKS_RESTORE_BEGIN, aInitialImport);
|
||||
try {
|
||||
if (!(yield OS.File.exists(aFilePath)))
|
||||
throw new Error("Cannot import from nonexisting html file");
|
||||
|
||||
if (!(yield OS.File.exists(aFilePath))) {
|
||||
throw new Error("Cannot import from nonexisting html file: " + aFilePath);
|
||||
}
|
||||
let importer = new BookmarkImporter(aInitialImport);
|
||||
yield importer.importFromURL(OS.Path.toFileURI(aFilePath));
|
||||
|
||||
|
@ -91,7 +91,7 @@ var tests = [
|
||||
folderId: null,
|
||||
run: function () {
|
||||
this.file = Services.dirsvc.get("ProfD", Ci.nsILocalFile);
|
||||
this.file.append("this file doesn't exist because nobody created it");
|
||||
this.file.append("this file doesn't exist because nobody created it 1");
|
||||
Task.spawn(function() {
|
||||
try {
|
||||
yield BookmarkJSONUtils.importFromFile(this.file, true);
|
||||
@ -152,16 +152,15 @@ var tests = [
|
||||
finalTopic: NSIOBSERVER_TOPIC_FAILED,
|
||||
data: NSIOBSERVER_DATA_HTML,
|
||||
folderId: null,
|
||||
run: function () {
|
||||
run: Task.async(function* () {
|
||||
this.file = Services.dirsvc.get("ProfD", Ci.nsILocalFile);
|
||||
this.file.append("this file doesn't exist because nobody created it");
|
||||
this.file.append("this file doesn't exist because nobody created it 2");
|
||||
try {
|
||||
BookmarkHTMLUtils.importFromFile(this.file, false)
|
||||
.then(function onSuccess() do_throw("Should fail!"),
|
||||
null);
|
||||
yield BookmarkHTMLUtils.importFromFile(this.file, false);
|
||||
do_throw("Should fail!");
|
||||
}
|
||||
catch (e) {}
|
||||
}
|
||||
}.bind(this))
|
||||
},
|
||||
|
||||
{
|
||||
@ -213,16 +212,15 @@ var tests = [
|
||||
finalTopic: NSIOBSERVER_TOPIC_FAILED,
|
||||
data: NSIOBSERVER_DATA_HTML_INIT,
|
||||
folderId: null,
|
||||
run: function () {
|
||||
run: Task.async(function* () {
|
||||
this.file = Services.dirsvc.get("ProfD", Ci.nsILocalFile);
|
||||
this.file.append("this file doesn't exist because nobody created it");
|
||||
this.file.append("this file doesn't exist because nobody created it 3");
|
||||
try {
|
||||
BookmarkHTMLUtils.importFromFile(this.file, true)
|
||||
.then(function onSuccess() do_throw("Should fail!"),
|
||||
null);
|
||||
yield BookmarkHTMLUtils.importFromFile(this.file, true);
|
||||
do_throw("Should fail!");
|
||||
}
|
||||
catch (e) {}
|
||||
}
|
||||
}.bind(this))
|
||||
}
|
||||
];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user