Backed out changeset 70253d6678af (bug 1295072) for failures in browser_ext_tabs_create.js

This commit is contained in:
Phil Ringnalda 2017-02-05 13:23:21 -08:00
Родитель 29445aa7ba
Коммит a17e96d752
2 изменённых файлов: 1 добавлений и 37 удалений

Просмотреть файл

@ -418,10 +418,6 @@ extensions.registerSchemaAPI("tabs", "addon_parent", context => {
window.gBrowser.pinTab(tab);
}
if (active && !url) {
window.focusAndSelectUrlBar();
}
if (createProperties.url && createProperties.url !== window.BROWSER_NEW_TAB_URL) {
// We can't wait for a location change event for about:newtab,
// since it may be pre-rendered, in which case its initial

Просмотреть файл

@ -2,7 +2,7 @@
/* vim: set sts=2 sw=2 et tw=80: */
"use strict";
add_task(function* test_create_options() {
add_task(function* () {
let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "about:robots");
gBrowser.selectedTab = tab;
@ -164,35 +164,3 @@ add_task(function* test_create_options() {
yield BrowserTestUtils.removeTab(tab);
});
add_task(function* test_urlbar_focus() {
const extension = ExtensionTestUtils.loadExtension({
background() {
browser.test.onMessage.addListener(async (cmd, ...args) => {
const result = await browser.tabs[cmd](...args);
browser.test.sendMessage("result", result);
});
},
});
yield extension.startup();
// Test content is focused after opening a regular url
extension.sendMessage("create", {url: "https://example.com"});
const tab1 = yield extension.awaitMessage("result");
is(document.activeElement.tagName, "browser", "Content focused after opening a web page");
extension.sendMessage("remove", tab1.id);
yield extension.awaitMessage("result");
// Test urlbar is focused after opening an empty tab
extension.sendMessage("create", {});
const tab2 = yield extension.awaitMessage("result");
ok(gURLBar.focused, "Urlbar focused after opening an empty tab");
extension.sendMessage("remove", tab2.id);
yield extension.awaitMessage("result");
yield extension.unload();
});