cleanup Places browserGlue tests

RESOLVED FIXED in Firefox 3.7a1

Status

()

Firefox
Bookmarks & History
RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: mak, Assigned: mak)

Tracking

Trunk
Firefox 3.7a1
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

9 years ago
Created attachment 420887 [details] [diff] [review]
patch v1.0

for better usage of notifications.

i'm already cleaning up _smartBookmarks and _prefs since they are randomly failing and i hope to make them consistent.
This handles the other tests, that are working but could be better.
Attachment #420887 - Flags: review?(dietrich)
Comment on attachment 420887 [details] [diff] [review]
patch v1.0


>diff --git a/browser/components/places/tests/unit/test_browserGlue_migrate.js b/browser/components/places/tests/unit/test_browserGlue_migrate.js
>--- a/browser/components/places/tests/unit/test_browserGlue_migrate.js
>+++ b/browser/components/places/tests/unit/test_browserGlue_migrate.js
>@@ -79,13 +77,8 @@ function run_test() {
>                     bs.DEFAULT_INDEX, "migrated");
> 
>   // Initialize nsBrowserGlue.
>-  Cc["@mozilla.org/browser/browserglue;1"].getService(Ci.nsIBrowserGlue);
>-
>-  // Places initialization has already happened, so we need to simulate
>-  // it. This will force browserGlue::_initPlaces().
>-  let os = Cc["@mozilla.org/observer-service;1"].
>-           getService(Ci.nsIObserverService);
>-  os.notifyObservers(null, TOPIC_PLACES_INIT_COMPLETE, null);
>+  let bg = Cc["@mozilla.org/browser/browserglue;1"].
>+           getService(Ci.nsIBrowserGlue);

why don't you need to send the notification here anymore?
(Assignee)

Comment 2

9 years ago
because initing any Places service enqueues the notification, when we later call do_timeout the enqueued notification will be served, so no reason to force it.
Attachment #420887 - Flags: review?(dietrich) → review+
(Assignee)

Comment 3

9 years ago
http://hg.mozilla.org/mozilla-central/rev/6c1fb8fedeae
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 3.7a1
You need to log in before you can comment on or make changes to this bug.