add: */ 
context: function run_test() {  // get places import/export service  var importer = Cc["@mozilla.org/browser/places/import-export-service;1"].getService(Ci.nsIPlacesImportExportService);  // file pointer to legacy bookmarks file  var bookmarksFileOld = do_get_file("browser/components/places/tests/unit/bookmarks.preplaces.html");  // file pointer to a new places-exported bookmarks file  var bookmarksFileNew = dirSvc.get("ProfD", Ci.nsILocalFile);  bookmarksFileNew.append("bookmarks.exported.html");  // create bookmarks.exported.html  if (bookmarksFileNew.exists())    bookmarksFileNew.remove(false);  bookmarksFileNew.create(Ci.nsILocalFile.NORMAL_FILE_TYPE, 0600);  if (!bookmarksFileNew.exists())    do_throw("couldn't create file: bookmarks.exported.html");  // Test importing a pre-Places canonical bookmarks file.  // 1. import bookmarks.preplaces.html  // 2. run the test-suite  // Note: we do not empty the db before this import to catch bugs like 380999  try {    importer.importHTMLFromFile(bookmarksFileOld, true);  } catch(ex) { do_throw("couldn't import legacy bookmarks file: " + ex); }  testCanonicalBookmarks(bmsvc.bookmarksRoot);   // Test exporting a Places canonical bookmarks file.  // 1. export to bookmarks.exported.html  // 2. empty bookmarks db  // 3. import bookmarks.exported.html  // 4. run the test-suite  try {    importer.exportHTMLToFile(bookmarksFileNew);  } catch(ex) { do_throw("couldn't export to file: " + ex); }  bmsvc.removeFolderChildren(bmsvc.bookmarksRoot);  try {    importer.importHTMLFromFile(bookmarksFileNew, true);  } catch(ex) { do_throw("couldn't import the exported file: " + ex); }  testCanonicalBookmarks(bmsvc.bookmarksRoot);   /*  // XXX import-to-folder tests disabled due to bug 363634  // Test importing a pre-Places canonical bookmarks file to a specific folder.  // 1. create a new folder  // 2. import bookmarks.preplaces.html to that folder  // 3. run the test-suite  var testFolder = bmsvc.createFolder(bmsvc.bookmarksRoot, "test-import", bmsvc.DEFAULT_INDEX);  try {    importer.importHTMLFromFileToFolder(bookmarksFileOld, testFolder, false);  } catch(ex) { do_throw("couldn't import the exported file to folder: " + ex); }  testCanonicalBookmarks(testFolder);  bmsvc.removeFolder(testFolder);  // Test importing a Places canonical bookmarks file to a specific folder.  // 1. create a new folder  // 2. import bookmarks.exported.html to that folder  // 3. run the test-suite  var testFolder = bmsvc.createFolder(bmsvc.bookmarksRoot, "test-import", bmsvc.DEFAULT_INDEX);  try {    importer.importHTMLFromFileToFolder(bookmarksFileNew, testFolder, false);  } catch(ex) { do_throw("couldn't import the exported file to folder: " + ex); }  testCanonicalBookmarks(testFolder);   bmsvc.removeFolder(testFolder);  */  // Test importing the exported bookmarks.html file *on top of* the existing  // bookmarks. This tests import of IDs. If we support IDs correctly, there  // should be no difference after the import.  // 1. empty bookmarks db  // 2. import the exported bookmarks file  // 3. export to file  // 3. import the exported bookmarks file  // 4. run the test-suite  bmsvc.removeFolderChildren(bmsvc.bookmarksRoot);  try {    importer.importHTMLFromFile(bookmarksFileNew, true);  } catch(ex) { do_throw("couldn't import the exported file: " + ex); }  try {    importer.exportHTMLToFile(bookmarksFileNew);  } catch(ex) { do_throw("couldn't export to file: " + ex); }  try {    importer.importHTMLFromFile(bookmarksFileNew, true);  } catch(ex) { do_throw("couldn't import the exported file: " + ex); }  testCanonicalBookmarks(bmsvc.bookmarksRoot);  /*  XXX if there are new fields we add to the bookmarks HTML format  then test them here  Test importing a Places canonical bookmarks file  1. empty the bookmarks datastore  2. import bookmarks.places.html  3. run the test-suite  4. run the additional-test-suite  */}
meta: 10520	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/10520/02bad2fee816b5bac5297df4a9d99879b8dfaeca/test_bookmarks_html.js/buggy/browser/components/places/tests/unit/test_bookmarks_html.js