Bug 1073855 - fix browser_datareporting_notification tests for dialog-based prefs. r=gfritzsche
authorMark Hammond <mhammond@skippinet.com.au>
Tue, 30 Sep 2014 09:52:39 +1000
changeset 207906 2b72cf7356e2dfe1daf3e2f353527d53b8512811
parent 207905 ae7c7d39ec2ee31c7eb6ad7cf19a8cbdb6b89c30
child 207907 b327a052e47f917b1d2678a98e1e64b085f663de
push id27569
push usercbook@mozilla.com
push dateTue, 30 Sep 2014 13:14:19 +0000
treeherderautoland@2ae57957e4bb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgfritzsche
bugs1073855
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1073855 - fix browser_datareporting_notification tests for dialog-based prefs. r=gfritzsche
browser/base/content/test/general/browser_datareporting_notification.js
--- a/browser/base/content/test/general/browser_datareporting_notification.js
+++ b/browser/base/content/test/general/browser_datareporting_notification.js
@@ -196,16 +196,21 @@ function test_multiple_windows() {
       // Add an observer to ensure the "advanced" pane opened (but don't bother
       // closing it - we close the entire window when done.)
       Services.obs.addObserver(function observer(prefWin, topic, data) {
         Services.obs.removeObserver(observer, "advanced-pane-loaded");
 
         ok(true, "Advanced preferences opened on info bar button press.");
         executeSoon(function soon() {
           prefWindowOpened = true;
+          // If the prefs are being displayed in a dialog we need to close it.
+          // If in a tab (ie, in-content prefs) it closes with the window.
+          if (!Services.prefs.getBoolPref("browser.preferences.inContent")) {
+            prefWin.close();
+          }
           maybeFinish();
         });
       }, "advanced-pane-loaded", false);
 
       button.click();
     }
 
     notification1.addEventListener("AlertActive", function active1() {