Bug 1381706 - Don't wait for XBL construction in the handler applications list tests. r=bgrins

MozReview-Commit-ID: GL2SruwqBDs

--HG--
extra : rebase_source : 8376331823fa8e4eecdfb50a10f4ccbcb0a28060
This commit is contained in:
Paolo Amadini 2018-07-18 13:51:57 +01:00
Родитель dd4332f07c
Коммит 46dbbe67ce
3 изменённых файлов: 8 добавлений и 24 удалений

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

@ -9,7 +9,6 @@ support-files =
addons/set_newtab.xpi
[browser_applications_selection.js]
skip-if = os == 'linux' || verify # bug 1382057
[browser_advanced_update.js]
skip-if = !updater
[browser_basic_rebuild_fonts_test.js]
@ -36,9 +35,7 @@ skip-if = !updater
support-files =
browser_bug1184989_prevent_scrolling_when_preferences_flipped.xul
[browser_change_app_handler.js]
skip-if = os != "win" || (os == "win" && os_version == "6.1") || (verify && debug)
# This test tests the windows-specific app selection dialog, so can't run on non-Windows.
# Skip the test on Window 7, see the detail at Bug 1381706.
skip-if = os != "win" # Windows-specific handler application selection dialog
[browser_checkspelling.js]
[browser_connection.js]
[browser_connection_bug388287.js]

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

@ -30,10 +30,7 @@ add_task(async function selectInternalOptionForFeed() {
container.selectItem(feedItem);
Assert.ok(feedItem.selected, "Should be able to select our item.");
// Wait for the menu.
let list = await TestUtils.waitForCondition(() =>
win.document.getAnonymousElementByAttribute(feedItem, "class", "actionsMenu"));
info("Got list after item was selected");
let list = feedItem.querySelector(".actionsMenu");
// Find the "Add Live bookmarks option".
let chooseItems = list.getElementsByAttribute("action", Ci.nsIHandlerInfo.handleInternally);
@ -45,9 +42,6 @@ add_task(async function selectInternalOptionForFeed() {
chooseItems[0].dispatchEvent(cmdEvent);
// Check that we display the correct result.
list = await TestUtils.waitForCondition(() =>
win.document.getAnonymousElementByAttribute(feedItem, "class", "actionsMenu"));
info("Got list after item was selected");
Assert.ok(list.selectedItem, "Should have a selected item.");
Assert.equal(list.selectedItem.getAttribute("action"),
Ci.nsIHandlerInfo.handleInternally,
@ -62,17 +56,10 @@ add_task(async function reselectInternalOptionForFeed() {
container.selectItem(anotherItem);
// Wait for the menu so that we don't hit race conditions.
await TestUtils.waitForCondition(() =>
win.document.getAnonymousElementByAttribute(anotherItem, "class", "actionsMenu"));
info("Got list after item was selected");
// Now select the feed item again, and check what it is displaying.
container.selectItem(feedItem);
let list = await TestUtils.waitForCondition(() =>
win.document.getAnonymousElementByAttribute(feedItem, "class", "actionsMenu"));
info("Got list after item was selected");
let list = feedItem.querySelector(".actionsMenu");
Assert.ok(list.selectedItem,
"Should have a selected item");
@ -118,6 +105,10 @@ add_task(async function sortingCheck() {
actionColumn.click();
assertSortByAction("descending");
// Restore the default sort order
typeColumn.click();
assertSortByType("ascending");
function assertSortByAction(order) {
Assert.equal(actionColumn.getAttribute("sortDirection"),
order,

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

@ -28,8 +28,7 @@ add_task(async function() {
container.selectItem(ourItem);
ok(ourItem.selected, "Should be able to select our item.");
let list = await TestUtils.waitForCondition(() => win.document.getAnonymousElementByAttribute(ourItem, "class", "actionsMenu"));
info("Got list after item was selected");
let list = ourItem.querySelector(".actionsMenu");
let chooseItem = list.firstChild.querySelector(".choose-app-item");
let dialogLoadedPromise = promiseLoadSubDialog("chrome://global/content/appPicker.xul");
@ -51,8 +50,6 @@ add_task(async function() {
ok(mimeInfo.preferredApplicationHandler.equals(selectedApp), "App should be set as preferred.");
// Check that we display this result:
list = await TestUtils.waitForCondition(() => win.document.getAnonymousElementByAttribute(ourItem, "class", "actionsMenu"));
info("Got list after item was selected");
ok(list.selectedItem, "Should have a selected item");
ok(mimeInfo.preferredApplicationHandler.equals(list.selectedItem.handlerApp),
"App should be visible as preferred item.");
@ -84,7 +81,6 @@ add_task(async function() {
ok(!mimeInfo.preferredApplicationHandler, "App should no longer be set as preferred.");
// Check that we display this result:
list = await TestUtils.waitForCondition(() => win.document.getAnonymousElementByAttribute(ourItem, "class", "actionsMenu"));
ok(list.selectedItem, "Should have a selected item");
ok(!list.selectedItem.handlerApp,
"No app should be visible as preferred item.");