diff options
author | Matt A. Tobin <email@mattatobin.com> | 2018-02-03 06:00:38 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2018-02-03 06:00:38 -0500 |
commit | 8148615da179fdd60f19018e13b4e94b95609cc6 (patch) | |
tree | 771fccdd99fa3adf35fdd2c81d8197b415a89b91 /browser/components/sessionstore/test/browser_async_duplicate_tab.js | |
parent | 494802c1be7888025b95260d23db187467d2b9dd (diff) | |
download | UXP-8148615da179fdd60f19018e13b4e94b95609cc6.tar UXP-8148615da179fdd60f19018e13b4e94b95609cc6.tar.gz UXP-8148615da179fdd60f19018e13b4e94b95609cc6.tar.lz UXP-8148615da179fdd60f19018e13b4e94b95609cc6.tar.xz UXP-8148615da179fdd60f19018e13b4e94b95609cc6.zip |
Remove browser tests - Part 1: The Tests (except for experiments)
Diffstat (limited to 'browser/components/sessionstore/test/browser_async_duplicate_tab.js')
-rw-r--r-- | browser/components/sessionstore/test/browser_async_duplicate_tab.js | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/browser/components/sessionstore/test/browser_async_duplicate_tab.js b/browser/components/sessionstore/test/browser_async_duplicate_tab.js deleted file mode 100644 index 8696a284f..000000000 --- a/browser/components/sessionstore/test/browser_async_duplicate_tab.js +++ /dev/null @@ -1,78 +0,0 @@ -"use strict"; - -const URL = "data:text/html;charset=utf-8,<a href=%23>clickme</a>"; - -add_task(function* test_duplicate() { - // Create new tab. - let tab = gBrowser.addTab(URL); - let browser = tab.linkedBrowser; - yield promiseBrowserLoaded(browser); - - // Flush to empty any queued update messages. - yield TabStateFlusher.flush(browser); - - // Click the link to navigate, this will add second shistory entry. - yield ContentTask.spawn(browser, null, function* () { - return new Promise(resolve => { - addEventListener("hashchange", function onHashChange() { - removeEventListener("hashchange", onHashChange); - resolve(); - }); - - // Click the link. - content.document.querySelector("a").click(); - }); - }); - - // Duplicate the tab. - let tab2 = ss.duplicateTab(window, tab); - - // Wait until the tab has fully restored. - yield promiseTabRestored(tab2); - yield TabStateFlusher.flush(tab2.linkedBrowser); - - // There should be two history entries now. - let {entries} = JSON.parse(ss.getTabState(tab2)); - is(entries.length, 2, "there are two shistory entries"); - - // Cleanup. - yield promiseRemoveTab(tab2); - yield promiseRemoveTab(tab); -}); - -add_task(function* test_duplicate_remove() { - // Create new tab. - let tab = gBrowser.addTab(URL); - let browser = tab.linkedBrowser; - yield promiseBrowserLoaded(browser); - - // Flush to empty any queued update messages. - yield TabStateFlusher.flush(browser); - - // Click the link to navigate, this will add second shistory entry. - yield ContentTask.spawn(browser, null, function* () { - return new Promise(resolve => { - addEventListener("hashchange", function onHashChange() { - removeEventListener("hashchange", onHashChange); - resolve(); - }); - - // Click the link. - content.document.querySelector("a").click(); - }); - }); - - // Duplicate the tab. - let tab2 = ss.duplicateTab(window, tab); - - // Before the duplication finished, remove the tab. - yield Promise.all([promiseRemoveTab(tab), promiseTabRestored(tab2)]); - yield TabStateFlusher.flush(tab2.linkedBrowser); - - // There should be two history entries now. - let {entries} = JSON.parse(ss.getTabState(tab2)); - is(entries.length, 2, "there are two shistory entries"); - - // Cleanup. - yield promiseRemoveTab(tab2); -}); |