summaryrefslogtreecommitdiffstats
path: root/browser/base/content/test/urlbar/browser_urlbarRaceWithTabs.js
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2018-02-03 06:00:38 -0500
committerMatt A. Tobin <email@mattatobin.com>2018-02-03 06:00:38 -0500
commit8148615da179fdd60f19018e13b4e94b95609cc6 (patch)
tree771fccdd99fa3adf35fdd2c81d8197b415a89b91 /browser/base/content/test/urlbar/browser_urlbarRaceWithTabs.js
parent494802c1be7888025b95260d23db187467d2b9dd (diff)
downloadUXP-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/base/content/test/urlbar/browser_urlbarRaceWithTabs.js')
-rw-r--r--browser/base/content/test/urlbar/browser_urlbarRaceWithTabs.js57
1 files changed, 0 insertions, 57 deletions
diff --git a/browser/base/content/test/urlbar/browser_urlbarRaceWithTabs.js b/browser/base/content/test/urlbar/browser_urlbarRaceWithTabs.js
deleted file mode 100644
index d66514c5a..000000000
--- a/browser/base/content/test/urlbar/browser_urlbarRaceWithTabs.js
+++ /dev/null
@@ -1,57 +0,0 @@
-const kURL = "http://example.org/browser/browser/base/content/test/urlbar/dummy_page.html";
-
-function* addBookmark(bookmark) {
- if (bookmark.keyword) {
- yield PlacesUtils.keywords.insert({
- keyword: bookmark.keyword,
- url: bookmark.url,
- });
- }
-
- let bm = yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: bookmark.url,
- title: bookmark.title,
- });
-
- registerCleanupFunction(function* () {
- yield PlacesUtils.bookmarks.remove(bm);
- if (bookmark.keyword) {
- yield PlacesUtils.keywords.remove(bookmark.keyword);
- }
- });
-}
-
-/**
- * Check that if the user hits enter and ctrl-t at the same time, we open the URL in the right tab.
- */
-add_task(function* hitEnterLoadInRightTab() {
- info("Opening new tab");
- let oldTabCreatedPromise = BrowserTestUtils.waitForEvent(gBrowser.tabContainer, "TabOpen");
- BrowserOpenTab();
- let oldTab = (yield oldTabCreatedPromise).target;
- let oldTabLoadedPromise = BrowserTestUtils.browserLoaded(oldTab.linkedBrowser, false, kURL);
- oldTabLoadedPromise.then(() => info("Old tab loaded"));
- let newTabCreatedPromise = BrowserTestUtils.waitForEvent(gBrowser.tabContainer, "TabOpen");
-
- info("Creating bookmark and keyword");
- yield addBookmark({title: "Test for keyword bookmark and URL", url: kURL, keyword: "urlbarkeyword"});
- info("Filling URL bar, sending <return> and opening a tab");
- gURLBar.value = "urlbarkeyword";
- gURLBar.select();
- EventUtils.sendKey("return");
- BrowserOpenTab();
- info("Waiting for new tab");
- let newTab = (yield newTabCreatedPromise).target;
- info("Created new tab; waiting for either tab to load");
- let newTabLoadedPromise = BrowserTestUtils.browserLoaded(newTab.linkedBrowser, false, kURL);
- newTabLoadedPromise.then(() => info("New tab loaded"));
- yield Promise.race([newTabLoadedPromise, oldTabLoadedPromise]);
- is(newTab.linkedBrowser.currentURI.spec, "about:newtab", "New tab still has about:newtab");
- is(oldTab.linkedBrowser.currentURI.spec, kURL, "Old tab loaded URL");
- info("Closing new tab");
- yield BrowserTestUtils.removeTab(newTab);
- info("Closing old tab");
- yield BrowserTestUtils.removeTab(oldTab);
- info("Finished");
-});