docshell/test/unit_ipc/test_pb_notification_ipc.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/docshell/test/unit_ipc/test_pb_notification_ipc.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,20 @@
     1.4 +const Cc = Components.classes;
     1.5 +const Ci = Components.interfaces;
     1.6 +
     1.7 +function run_test() {
     1.8 +  var notifications = 0;
     1.9 +  var obs = {
    1.10 +    observe: function(aSubject, aTopic, aData) {
    1.11 +      do_check_eq(aTopic, "last-pb-context-exited");
    1.12 +      notifications++;
    1.13 +    }
    1.14 +  };
    1.15 +  var os = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
    1.16 +  os.addObserver(obs, "last-pb-context-exited", false);
    1.17 + 
    1.18 +  run_test_in_child("../unit/test_pb_notification.js",
    1.19 +                    function() {
    1.20 +                      do_check_eq(notifications, 1);
    1.21 +                      do_test_finished();
    1.22 +                    });
    1.23 +}
    1.24 \ No newline at end of file

mercurial