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 24aaa1ae41a6f4272dbb0b44f5f289bd85238dd1
parent 208181 b295f329dfd37c2ea2205c791507275d9022c838
child 208183 61b30b605194289d14ed20f5766baeb3bf93380e
push id3754
push userryanvm@gmail.com
push dateMon, 28 Jul 2014 15:24:06 +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;
   },