From cec7acc473f3d8163de760f1daf7f595b4a149ca Mon Sep 17 00:00:00 2001 From: Dave Townsend Date: Thu, 30 Apr 2015 16:28:52 -0700 Subject: [PATCH] Bug 989469: Fix browser_gmpProvider.js to switch views correctly. r=spohl --- .../test/browser/browser_gmpProvider.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/toolkit/mozapps/extensions/test/browser/browser_gmpProvider.js b/toolkit/mozapps/extensions/test/browser/browser_gmpProvider.js index 1813df78cb98..8b80e0f3d986 100644 --- a/toolkit/mozapps/extensions/test/browser/browser_gmpProvider.js +++ b/toolkit/mozapps/extensions/test/browser/browser_gmpProvider.js @@ -69,10 +69,14 @@ function getInstallItem() { } function openDetailsView(aId) { + let view = gManagerWindow.document.getElementById("view-port").selectedPanel + Assert.equal(view.id, "list-view", "Should be in the list view to use this function"); + let item = get_addon_element(gManagerWindow, aId); Assert.ok(item, "Should have got add-on element."); is_element_visible(item, "Add-on element should be visible."); + item.scrollIntoView(); EventUtils.synthesizeMouseAtCenter(item, { clickCount: 1 }, gManagerWindow); EventUtils.synthesizeMouseAtCenter(item, { clickCount: 2 }, gManagerWindow); @@ -165,13 +169,12 @@ add_task(function* testNotInstalledDisabledDetails() { el = doc.getElementById("detail-warning"); is_element_hidden(el, "Warning notification is hidden."); el = doc.getElementsByTagName("setting")[0]; + + yield gCategoryUtilities.openType("plugin"); } }); add_task(function* testNotInstalled() { - Assert.ok(gCategoryUtilities.isTypeVisible("plugin"), "Plugin tab visible."); - yield gCategoryUtilities.openType("plugin"); - for (let addon of gMockAddons) { gPrefs.setBoolPref(getKey(GMPScope.GMPPrefs.KEY_PLUGIN_ENABLED, addon.id), true); let item = get_addon_element(gManagerWindow, addon.id); @@ -208,6 +211,8 @@ add_task(function* testNotInstalledDetails() { el = doc.getElementById("detail-warning"); is_element_visible(el, "Warning notification is visible."); el = doc.getElementsByTagName("setting")[0]; + + yield gCategoryUtilities.openType("plugin"); } }); @@ -218,8 +223,6 @@ add_task(function* testInstalled() { gPrefs.setBoolPref(getKey(GMPScope.GMPPrefs.KEY_PLUGIN_AUTOUPDATE, addon.id), false); gPrefs.setCharPref(getKey(GMPScope.GMPPrefs.KEY_PLUGIN_VERSION, addon.id), "1.2.3.4"); - yield gCategoryUtilities.openType("plugin"); - let item = get_addon_element(gManagerWindow, addon.id); Assert.ok(item, "Got add-on element."); item.parentNode.ensureElementIsVisible(item); @@ -269,14 +272,14 @@ add_task(function* testInstalledDetails() { let menuSep = doc.getElementById("addonitem-menuseparator"); is_element_hidden(menuSep, "Menu separator is hidden."); contextMenu.hidePopup(); + + yield gCategoryUtilities.openType("plugin"); } }); add_task(function* testInstalledGlobalEmeDisabled() { gPrefs.setBoolPref(GMPScope.GMPPrefs.KEY_EME_ENABLED, false); for (let addon of gMockAddons) { - yield gCategoryUtilities.openType("plugin"); - let item = get_addon_element(gManagerWindow, addon.id); if (addon.isEME) { Assert.ok(!item, "Couldn't get add-on element.");