Bug 1036036 - Stop leaking docshells in Session Store tests. r=ttaubert, a=test-only
authorSteven MacLeod <smacleod@mozilla.com>
Thu, 24 Jul 2014 18:13:28 -0400
changeset 208182 24aaa1ae41a6
parent 208181 b295f329dfd3
child 208183 61b30b605194
push id3754
push userryanvm@gmail.com
push date2014-07-28 15:24 +0000
treeherdermozilla-beta@61b30b605194 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersttaubert, test-only
bugs1036036, 1036031
milestone32.0
Bug 1036036 - Stop leaking docshells in Session Store tests. r=ttaubert, a=test-only When adding a SHistoryListener in the Session Store test frame script we were creating an intermediate global variable that was rooting the docshell. This prevented things from being GC'd properly. I've removed this intermediate variable and we should no longer keep the docshell alive. This will probably also fix Bug 1036031.
browser/components/sessionstore/test/content.js
--- a/browser/components/sessionstore/test/content.js
+++ b/browser/components/sessionstore/test/content.js
@@ -16,18 +16,20 @@ gFrameTree.addObserver({
     sendAsyncMessage("ss-test:onFrameTreeReset");
   },
 
   onFrameTreeCollected: function () {
     sendAsyncMessage("ss-test:onFrameTreeCollected");
   }
 });
 
-let webNav = docShell.QueryInterface(Ci.nsIWebNavigation);
-webNav.sessionHistory.addSHistoryListener({
+
+docShell.QueryInterface(Ci.nsIWebNavigation).
+  sessionHistory.addSHistoryListener({
+
   OnHistoryNewEntry: function () {
     sendAsyncMessage("ss-test:OnHistoryNewEntry");
   },
 
   OnHistoryGoBack: function () {
     sendAsyncMessage("ss-test:OnHistoryGoBack");
     return true;
   },