Bug 660686 - "Enable entire row region selection in Preferences" [r=mark.finkle]

This commit is contained in:
Sriram Ramasubramanian 2011-09-02 17:32:00 -04:00
Родитель 25a539fff5
Коммит 7e44db59e6
2 изменённых файлов: 59 добавлений и 0 удалений

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

@ -74,6 +74,7 @@ _BROWSER_FILES = \
browser_history.js \
browser_mainui.js \
browser_preferences_text.js \
browser_preferences_fulltoggle.js \
browser_rect.js \
browser_rememberPassword.js \
browser_scroll.js \

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

@ -0,0 +1,58 @@
// browser-chrome test for fennec preferences to toggle values while clicking on the preference name
var gTests = [];
var gCurrentTest = null;
function test() {
// The "runNextTest" approach is async, so we need to call "waitForExplicitFinish()"
// We call "finish()" when the tests are finished
waitForExplicitFinish();
// Start the tests
runNextTest();
}
//------------------------------------------------------------------------------
// Iterating tests by shifting test out one by one as runNextTest is called.
function runNextTest() {
// Run the next test until all tests completed
if (gTests.length > 0) {
gCurrentTest = gTests.shift();
info(gCurrentTest.desc);
gCurrentTest.run();
}
else {
// Cleanup. All tests are completed at this point
finish();
}
}
// -----------------------------------------------------------------------------------------
// Verify preferences and text
gTests.push({
desc: "Verify full toggle on Preferences",
run: function(){
// 1.Click preferences to view prefs
document.getElementById("tool-panel-open").click();
is(document.getElementById("panel-container").hidden, false, "Preferences should be visible");
var contentRegion = document.getElementById("prefs-content");
// Check for *Show images*
var imageRegion = document.getAnonymousElementByAttribute(contentRegion, "pref", "permissions.default.image");
var imageValue = imageRegion.value;
var imageTitle = document.getAnonymousElementByAttribute(imageRegion, "class", "preferences-title");
var imageButton = document.getAnonymousElementByAttribute(imageRegion, "anonid", "input");
imageButton.click();
is(imageRegion.value, !imageValue, "Tapping on input control should change the value");
imageTitle.click();
is(imageRegion.value, imageValue, "Tapping on the title should change the value");
imageRegion.click();
is(imageRegion.value, !imageValue, "Tapping on the setting should change the value");
BrowserUI.hidePanel();
is(document.getElementById("panel-container").hidden, true, "Preferences panel should be closed");
runNextTest();
}
});