Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | if (typeof Cc === "undefined") |
michael@0 | 2 | Cc = Components.classes; |
michael@0 | 3 | if (typeof Ci === "undefined") |
michael@0 | 4 | Ci = Components.interfaces; |
michael@0 | 5 | |
michael@0 | 6 | function destroy_transient_docshell() { |
michael@0 | 7 | var docshell = Cc["@mozilla.org/docshell;1"].createInstance(Ci.nsIDocShell); |
michael@0 | 8 | docshell.QueryInterface(Ci.nsILoadContext).usePrivateBrowsing = true; |
michael@0 | 9 | do_test_pending(); |
michael@0 | 10 | do_timeout(0, Components.utils.forceGC); |
michael@0 | 11 | } |
michael@0 | 12 | |
michael@0 | 13 | function run_test() { |
michael@0 | 14 | var obs = { |
michael@0 | 15 | observe: function(aSubject, aTopic, aData) { |
michael@0 | 16 | do_check_eq(aTopic, "last-pb-context-exited"); |
michael@0 | 17 | do_test_finished(); |
michael@0 | 18 | } |
michael@0 | 19 | }; |
michael@0 | 20 | var os = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService); |
michael@0 | 21 | os.addObserver(obs, "last-pb-context-exited", false); |
michael@0 | 22 | destroy_transient_docshell(); |
michael@0 | 23 | } |