diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-03-13 09:50:54 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-03-13 09:50:54 +0100 |
commit | 4c431486433428b18610c3578b693f3e1f1136eb (patch) | |
tree | 671b9cb9dc4c1abb5cd3525ca35beff2c762fc66 /services/cloudsync/tests/mochitest/browser_tabEvents.js | |
parent | bf0413359245579e9509146d42cd5547e35da695 (diff) | |
download | UXP-4c431486433428b18610c3578b693f3e1f1136eb.tar UXP-4c431486433428b18610c3578b693f3e1f1136eb.tar.gz UXP-4c431486433428b18610c3578b693f3e1f1136eb.tar.lz UXP-4c431486433428b18610c3578b693f3e1f1136eb.tar.xz UXP-4c431486433428b18610c3578b693f3e1f1136eb.zip |
Remove CloudSync
Tag #812
Diffstat (limited to 'services/cloudsync/tests/mochitest/browser_tabEvents.js')
-rw-r--r-- | services/cloudsync/tests/mochitest/browser_tabEvents.js | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/services/cloudsync/tests/mochitest/browser_tabEvents.js b/services/cloudsync/tests/mochitest/browser_tabEvents.js deleted file mode 100644 index 9d80090a0..000000000 --- a/services/cloudsync/tests/mochitest/browser_tabEvents.js +++ /dev/null @@ -1,79 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -function test() { - - let local = {}; - - Components.utils.import("resource://gre/modules/CloudSync.jsm", local); - Components.utils.import("resource:///modules/sessionstore/TabStateFlusher.jsm", local); - - let cloudSync = local.CloudSync(); - let opentabs = []; - - waitForExplicitFinish(); - - let testURL = "chrome://mochitests/content/browser/services/cloudsync/tests/mochitest/other_window.html"; - let expected = [ - testURL, - testURL+"?x=1", - testURL+"?x=%20a", - // testURL+"?x=å", - ]; - - let nevents = 0; - let nflushed = 0; - function handleTabChangeEvent () { - cloudSync.tabs.removeEventListener("change", handleTabChangeEvent); - ++ nevents; - info("tab change event " + nevents); - next(); - } - - function getLocalTabs() { - cloudSync.tabs.getLocalTabs().then( - function (tabs) { - for (let tab of tabs) { - ok(expected.indexOf(tab.url) >= 0, "found an expected tab"); - } - - is(tabs.length, expected.length, "found the right number of tabs"); - - opentabs.forEach(function (tab) { - gBrowser.removeTab(tab); - }); - - is(nevents, 1, "expected number of change events"); - - finish(); - } - ) - } - - cloudSync.tabs.addEventListener("change", handleTabChangeEvent); - - expected.forEach(function(url) { - let tab = gBrowser.addTab(url); - - function flush() { - tab.linkedBrowser.removeEventListener("load", flush, true); - local.TabStateFlusher.flush(tab.linkedBrowser).then(() => { - ++ nflushed; - info("flushed " + nflushed); - next(); - }); - } - - tab.linkedBrowser.addEventListener("load", flush, true); - - opentabs.push(tab); - }); - - function next() { - if (nevents == 1 && nflushed == expected.length) { - getLocalTabs(); - } - } - -} |