diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /browser/modules/test/browser_BrowserUITelemetry_sidebar.js | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-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_sidebar.js')
-rw-r--r-- | browser/modules/test/browser_BrowserUITelemetry_sidebar.js | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/browser/modules/test/browser_BrowserUITelemetry_sidebar.js b/browser/modules/test/browser_BrowserUITelemetry_sidebar.js new file mode 100644 index 000000000..5f19eabd5 --- /dev/null +++ b/browser/modules/test/browser_BrowserUITelemetry_sidebar.js @@ -0,0 +1,56 @@ +// Test the sidebar counters in BrowserUITelemetry. +"use strict"; + +const { BrowserUITelemetry: BUIT } = Cu.import("resource:///modules/BrowserUITelemetry.jsm", {}); + +add_task(function* testSidebarOpenClose() { + // Reset BrowserUITelemetry's world. + BUIT._countableEvents = {}; + + yield SidebarUI.show("viewTabsSidebar"); + + let counts = BUIT._countableEvents[BUIT.currentBucket]; + + Assert.deepEqual(counts, { sidebar: { viewTabsSidebar: { show: 1 } } }); + yield SidebarUI.hide(); + Assert.deepEqual(counts, { sidebar: { viewTabsSidebar: { show: 1, hide: 1 } } }); + + yield SidebarUI.show("viewBookmarksSidebar"); + Assert.deepEqual(counts, { + sidebar: { + viewTabsSidebar: { show: 1, hide: 1 }, + viewBookmarksSidebar: { show: 1 }, + } + }); + // Re-open the tabs sidebar while bookmarks is open - bookmarks should + // record a close. + yield SidebarUI.show("viewTabsSidebar"); + Assert.deepEqual(counts, { + sidebar: { + viewTabsSidebar: { show: 2, hide: 1 }, + viewBookmarksSidebar: { show: 1, hide: 1 }, + } + }); + yield SidebarUI.hide(); + Assert.deepEqual(counts, { + sidebar: { + viewTabsSidebar: { show: 2, hide: 2 }, + viewBookmarksSidebar: { show: 1, hide: 1 }, + } + }); + // Toggle - this will re-open viewTabsSidebar + yield SidebarUI.toggle("viewTabsSidebar"); + Assert.deepEqual(counts, { + sidebar: { + viewTabsSidebar: { show: 3, hide: 2 }, + viewBookmarksSidebar: { show: 1, hide: 1 }, + } + }); + yield SidebarUI.toggle("viewTabsSidebar"); + Assert.deepEqual(counts, { + sidebar: { + viewTabsSidebar: { show: 3, hide: 3 }, + viewBookmarksSidebar: { show: 1, hide: 1 }, + } + }); +}); |