rem: if (!bookmarksFileOld.exists()) bookmarksFileOld.create(Ci.nsILocalFile.NORMAL_FILE_TYPE, 0600); if (!bookmarksFileOld.exists()) 
add: if (!bookmarksFileNew.exists()) bookmarksFileNew.create(Ci.nsILocalFile.NORMAL_FILE_TYPE, 0600); if (!bookmarksFileNew.exists()) 
context: function run_test() {  // get places import/export service  var importer = Cc["@mozilla.org/browser/places/import-export-service;1"].getService(Ci.nsIPlacesImportExportService);  // get file pointers  var bookmarksFileOld = do_get_file("browser/components/places/tests/unit/bookmarks.preplaces.html");  var bookmarksFileNew = dirSvc.get("ProfD", Ci.nsILocalFile);  bookmarksFileNew.append("bookmarks.exported.html");  // create bookmarks.exported.html if necessary  if (!bookmarksFileOld.exists())    bookmarksFileOld.create(Ci.nsILocalFile.NORMAL_FILE_TYPE, 0600);  if (!bookmarksFileOld.exists())    do_throw("couldn't create file: bookmarks.exported.html");  // Test importing a non-Places canonical bookmarks file.  // 1. import bookmarks.preplaces.html  // 2. run the test-suite  bmsvc.removeFolderChildren(bmsvc.bookmarksRoot);  importer.importHTMLFromFile(bookmarksFileOld);  testCanonicalBookmarks(bmsvc.bookmarksRoot);   // Test exporting a Places canonical bookmarks file.  // 1. export to bookmarks.exported.html  // 2. import bookmarks.exported.html  // 3. run the test-suite  /*  importer.exportHTMLToFile(bookmarksFileNew);  bmsvc.removeFolderChildren(bmsvc.bookmarksRoot);  importer.importHTMLFromFile(bookmarksFileNew);  testCanonicalBookmarks(bmsvc.bookmarksRoot);   */  // 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", bmsvc.DEFAULT_INDEX);  importer.importHTMLFromFileToFolder(bookmarksFileNew, testFolder);  testCanonicalBookmarks(testFolder);   */  /*  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  */  /*  XXX could write another more generic testsuite:  - a function that fetches all descendant nodes of a folder with all non-static    node properties removed, and serializes w/ toSource()  - import a file, get serialization  - export it, re-import, get serialization  - do_check_eq(str1, str2)  */}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/8395/cce32bf90e14ada4e700726dc4edc2ba2be764af/test_bookmarks_html.js/clean/browser/components/places/tests/unit/test_bookmarks_html.js