Bug 825739 - Intermittent exception thrown by browser_bookmark_titles.js.
authorMarco Bonardo <mbonardo@mozilla.com>
Wed, 23 Jan 2013 15:01:29 +0100
changeset 119616 35e0c12f43320896fd43028390364e5f91f9bf30
parent 119615 9666a8ee56004cfbe28f1ba20668a6dd6f5b140a
child 119617 99dabf8d5e98757bb9dfccd6f62cff0c0a39827e
child 119642 ab062ee22a96ba70413370a2d815dea442b8d1dd
push id24208
push userryanvm@gmail.com
push dateWed, 23 Jan 2013 16:13:14 +0000
treeherdermozilla-central@35e0c12f4332 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs825739
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 825739 - Intermittent exception thrown by browser_bookmark_titles.js. r=Mano
browser/base/content/test/browser_bookmark_titles.js
--- a/browser/base/content/test/browser_bookmark_titles.js
+++ b/browser/base/content/test/browser_bookmark_titles.js
@@ -1,37 +1,40 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // This file is tests for the default titles that new bookmarks get.
 
 let tests = [
+    // Common page.
     ['http://example.com/browser/browser/base/content/test/dummy_page.html',
      'Dummy test page'],
-    ['data:text/html;charset=utf-8,<title>test data: url</title>',
+    // Data URI.
+    ['data:text/html;charset=utf-8,<title>test%20data:%20url</title>',
      'test data: url'],
-    ['http://unregistered-domain.example',
-     'http://unregistered-domain.example/'],
+    // about:neterror
+    ['data:application/vnd.mozilla.xul+xml,',
+     'data:application/vnd.mozilla.xul+xml,'],
+    // about:certerror
     ['https://untrusted.example.com/somepage.html',
      'https://untrusted.example.com/somepage.html']
 ];
 
 function generatorTest() {
     gBrowser.selectedTab = gBrowser.addTab();
     let browser = gBrowser.selectedBrowser;
+    browser.stop(); // stop the about:blank load.
 
     browser.addEventListener("DOMContentLoaded", nextStep, true);
     registerCleanupFunction(function () {
         browser.removeEventListener("DOMContentLoaded", nextStep, true);
         gBrowser.removeCurrentTab();
     });
 
-    yield; // Wait for the new tab to load.
-
     // Test that a bookmark of each URI gets the corresponding default title.
     for (let i = 0; i < tests.length; ++i) {
         let [uri, title] = tests[i];
         content.location = uri;
         yield;
         checkBookmark(uri, title);
     }
 
@@ -59,17 +62,16 @@ function generatorTest() {
         "Offline mode successfully simulated network outage.");
     checkBookmark(uri, title);
 }
 
 // Bookmark the current page and confirm that the new bookmark has the expected
 // title. (Then delete the bookmark.)
 function checkBookmark(uri, expected_title) {
     PlacesCommandHook.bookmarkCurrentPage(false);
-    
+
     let id = PlacesUtils.getMostRecentBookmarkForURI(PlacesUtils._uri(uri));
+    ok(id > 0, "Found the expected bookmark");
     let title = PlacesUtils.bookmarks.getItemTitle(id);
-
     is(title, expected_title, "Bookmark got a good default title.");
 
     PlacesUtils.bookmarks.removeItem(id);
 }
-