summaryrefslogtreecommitdiffstats
path: root/browser/modules/test/browser_BrowserUITelemetry_defaults.js
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /browser/modules/test/browser_BrowserUITelemetry_defaults.js
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'browser/modules/test/browser_BrowserUITelemetry_defaults.js')
-rw-r--r--browser/modules/test/browser_BrowserUITelemetry_defaults.js37
1 files changed, 37 insertions, 0 deletions
diff --git a/browser/modules/test/browser_BrowserUITelemetry_defaults.js b/browser/modules/test/browser_BrowserUITelemetry_defaults.js
new file mode 100644
index 000000000..ced1bbce0
--- /dev/null
+++ b/browser/modules/test/browser_BrowserUITelemetry_defaults.js
@@ -0,0 +1,37 @@
+// The purpose of this test is to ensure that by default, BrowserUITelemetry
+// isn't reporting any UI customizations. This is primarily so changes to
+// customizableUI (eg, new buttons, button location changes) also have a
+// corresponding BrowserUITelemetry change.
+
+function test() {
+ let s = {};
+ Cu.import("resource:///modules/CustomizableUI.jsm", s);
+ Cu.import("resource:///modules/BrowserUITelemetry.jsm", s);
+
+ let { CustomizableUI, BrowserUITelemetry } = s;
+
+ // Bug 1278176 - DevEdition never has the UI in a default state by default.
+ if (!AppConstants.MOZ_DEV_EDITION) {
+ Assert.ok(CustomizableUI.inDefaultState,
+ "No other test should have left CUI in a dirty state.");
+ }
+
+ let result = BrowserUITelemetry._getWindowMeasurements(window, 0);
+
+ // Bug 1278176 - DevEdition always reports the developer-button is moved.
+ if (!AppConstants.MOZ_DEV_EDITION) {
+ Assert.deepEqual(result.defaultMoved, []);
+ }
+ Assert.deepEqual(result.nondefaultAdded, []);
+ // This one is a bit weird - the "social-share-button" is dynamically added
+ // to the toolbar as the feature is first used - but it's listed as being in
+ // the toolbar by default so it doesn't end up in nondefaultAdded once it
+ // is created. The end result is that it ends up in defaultRemoved before
+ // the feature has been activated.
+ // Bug 1273358 exists to fix this.
+ Assert.deepEqual(result.defaultRemoved, ["social-share-button"]);
+
+ // And mochi insists there's only a single window with a single tab when
+ // starting a test, so check that for good measure.
+ Assert.deepEqual(result.visibleTabs, [1]);
+}