diff options
Diffstat (limited to 'toolkit/mozapps/extensions/test/browser/browser_inlinesettings_info.js')
-rw-r--r-- | toolkit/mozapps/extensions/test/browser/browser_inlinesettings_info.js | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/toolkit/mozapps/extensions/test/browser/browser_inlinesettings_info.js b/toolkit/mozapps/extensions/test/browser/browser_inlinesettings_info.js index ce618b7fa..05b43a238 100644 --- a/toolkit/mozapps/extensions/test/browser/browser_inlinesettings_info.js +++ b/toolkit/mozapps/extensions/test/browser/browser_inlinesettings_info.js @@ -3,7 +3,6 @@ */ // Tests various aspects of the details view -Components.utils.import("resource://gre/modules/Preferences.jsm"); var gManagerWindow; var gCategoryUtilities; @@ -89,14 +88,14 @@ function test() { optionsURL: CHROMEROOT + "options.xul", optionsType: AddonManager.OPTIONS_TYPE_INLINE_INFO, operationsRequiringRestart: AddonManager.OP_NEEDS_RESTART_DISABLE, - }, { + },{ id: "inlinesettings3@tests.mozilla.org", name: "Inline Settings (More Options)", description: "Tests for option types introduced after Mozilla 7.0", version: "1", optionsURL: CHROMEROOT + "more_options.xul", optionsType: AddonManager.OPTIONS_TYPE_INLINE_INFO - }, { + },{ id: "noninlinesettings@tests.mozilla.org", name: "Non-Inline Settings", version: "1", @@ -215,7 +214,7 @@ add_test(function() { ok(!settings[1].hasAttribute("first-row"), "Not the first row"); Services.prefs.setIntPref("extensions.inlinesettings1.boolint", 0); - input = gManagerWindow.document.getAnonymousElementByAttribute(settings[1], "anonid", "input"); + var input = gManagerWindow.document.getAnonymousElementByAttribute(settings[1], "anonid", "input"); isnot(input.checked, true, "Checkbox should have initial value"); EventUtils.synthesizeMouseAtCenter(input, { clickCount: 1 }, gManagerWindow); is(input.checked, true, "Checkbox should have updated value"); @@ -226,7 +225,7 @@ add_test(function() { ok(!settings[2].hasAttribute("first-row"), "Not the first row"); Services.prefs.setIntPref("extensions.inlinesettings1.integer", 0); - input = gManagerWindow.document.getAnonymousElementByAttribute(settings[2], "anonid", "input"); + var input = gManagerWindow.document.getAnonymousElementByAttribute(settings[2], "anonid", "input"); is(input.value, "0", "Number box should have initial value"); input.select(); EventUtils.synthesizeKey("1", {}, gManagerWindow); @@ -239,7 +238,7 @@ add_test(function() { ok(!settings[3].hasAttribute("first-row"), "Not the first row"); Services.prefs.setCharPref("extensions.inlinesettings1.string", "foo"); - input = gManagerWindow.document.getAnonymousElementByAttribute(settings[3], "anonid", "input"); + var input = gManagerWindow.document.getAnonymousElementByAttribute(settings[3], "anonid", "input"); is(input.value, "foo", "Text box should have initial value"); input.select(); EventUtils.synthesizeKey("b", {}, gManagerWindow); @@ -249,7 +248,7 @@ add_test(function() { is(Services.prefs.getCharPref("extensions.inlinesettings1.string"), "bar", "String pref should have been updated"); ok(!settings[4].hasAttribute("first-row"), "Not the first row"); - input = settings[4].firstElementChild; + var input = settings[4].firstElementChild; is(input.value, "1", "Menulist should have initial value"); input.focus(); EventUtils.synthesizeKey("b", {}, gManagerWindow); @@ -272,10 +271,6 @@ add_test(function() { try { ok(!settings[6].hasAttribute("first-row"), "Not the first row"); var button = gManagerWindow.document.getAnonymousElementByAttribute(settings[6], "anonid", "button"); - - // Workaround for bug 1155324 - we need to ensure that the button is scrolled into view. - button.scrollIntoView(); - input = gManagerWindow.document.getAnonymousElementByAttribute(settings[6], "anonid", "input"); is(input.value, "", "Label value should be empty"); is(input.tooltipText, "", "Label tooltip should be empty"); @@ -359,7 +354,7 @@ add_test(function() { ok(!settings[1].hasAttribute("first-row"), "Not the first row"); Services.prefs.setIntPref("extensions.inlinesettings3.radioInt", 5); - radios = settings[1].getElementsByTagName("radio"); + var radios = settings[1].getElementsByTagName("radio"); isnot(radios[0].selected, true, "Correct radio button should be selected"); is(radios[1].selected, true, "Correct radio button should be selected"); isnot(radios[2].selected, true, "Correct radio button should be selected"); @@ -370,14 +365,14 @@ add_test(function() { ok(!settings[2].hasAttribute("first-row"), "Not the first row"); Services.prefs.setCharPref("extensions.inlinesettings3.radioString", "juliet"); - radios = settings[2].getElementsByTagName("radio"); + var radios = settings[2].getElementsByTagName("radio"); isnot(radios[0].selected, true, "Correct radio button should be selected"); is(radios[1].selected, true, "Correct radio button should be selected"); isnot(radios[2].selected, true, "Correct radio button should be selected"); EventUtils.synthesizeMouseAtCenter(radios[0], { clickCount: 1 }, gManagerWindow); is(Services.prefs.getCharPref("extensions.inlinesettings3.radioString"), "india", "Radio pref should have been updated"); EventUtils.synthesizeMouseAtCenter(radios[2], { clickCount: 1 }, gManagerWindow); - is(Preferences.get("extensions.inlinesettings3.radioString", "wrong"), "kilo \u338F", "Radio pref should have been updated"); + is(Services.prefs.getCharPref("extensions.inlinesettings3.radioString"), "kilo", "Radio pref should have been updated"); ok(!settings[3].hasAttribute("first-row"), "Not the first row"); Services.prefs.setIntPref("extensions.inlinesettings3.menulist", 8); @@ -441,7 +436,7 @@ add_test(function() { is_element_hidden(node, "Unsupported settings should not be visible"); ok(!node.hasAttribute("first-row"), "Hidden row is not the first row"); - button = gManagerWindow.document.getElementById("detail-prefs-btn"); + var button = gManagerWindow.document.getElementById("detail-prefs-btn"); is_element_hidden(button, "Preferences button should not be visible"); gCategoryUtilities.openType("extension", run_next_test); |