Figure out if mozapps/extensions unit tests can use do_shutdown

RESOLVED INVALID

Status

()

Toolkit
Add-ons Manager
RESOLVED INVALID
9 years ago
4 months ago

People

(Reporter: Ehsan, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

9 years ago
This line <http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/test/unit/test_bug430120.js#100> might be able to use the do_shutdown function to be added in bug 411415.  I tried calling do_shutdown there but the test crashed.  It might be worth investigating if it's possible to use do_shutdown there.

Also, it seems that the shutdownEM function assumes that the xpcshell suite automatically sends out xpcom-shutdown, but this assumption is not correct.
(In reply to comment #0)
> Also, it seems that the shutdownEM function assumes that the xpcshell suite
> automatically sends out xpcom-shutdown, but this assumption is not correct.

Are you sure about that? I was under the impression (and I'm pretty sure I verified at the time) that when XPCOM gets shut down the xpcom-shutdown notification is sent. Maybe with no explicit act by xpcshell, but sent nonetheless.
(Reporter)

Comment 2

9 years ago
(In reply to comment #1)
> (In reply to comment #0)
> > Also, it seems that the shutdownEM function assumes that the xpcshell suite
> > automatically sends out xpcom-shutdown, but this assumption is not correct.
> 
> Are you sure about that? I was under the impression (and I'm pretty sure I
> verified at the time) that when XPCOM gets shut down the xpcom-shutdown
> notification is sent. Maybe with no explicit act by xpcshell, but sent
> nonetheless.

I'm pretty sure, but Ted or Serge might know better.

I just verified my own claim by a simple test program:

function run_test() {
  var os = Cc["@mozilla.org/observer-service;1"].
           getService(Ci.nsIObserverService);

  var observer = {
    observe: function (aSubject, aTopic, aData) {
      do_throw("shouldn't get any notifications");
    }
  };
  os.addObserver(observer, "*", false);
}

This clearly shows that xpcshell harness by default doesn't send any kind of notifications.
(In reply to comment #2)
> (In reply to comment #1)
> > (In reply to comment #0)
> > > Also, it seems that the shutdownEM function assumes that the xpcshell suite
> > > automatically sends out xpcom-shutdown, but this assumption is not correct.
> > 
> > Are you sure about that? I was under the impression (and I'm pretty sure I
> > verified at the time) that when XPCOM gets shut down the xpcom-shutdown
> > notification is sent. Maybe with no explicit act by xpcshell, but sent
> > nonetheless.
> 
> I'm pretty sure, but Ted or Serge might know better.

It doesn't matter, seems immaterial to this bug anyway
xpcshell sends xpcom-shutdown, and if you invoke do_get_profile it will also fire profile-change-net-teardown, profile-change-teardown and profile-before-change.
The link here is no longer works and I can't find any reference to do_shutdown() in the tree, I think this can be safely declared obsolete.
Status: NEW → RESOLVED
Last Resolved: 4 months ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.