Bug 657462: don't select the first item in the download manager automatically, r=dolske

--HG--
extra : rebase_source : d84c3ce6b80048c2a0c8c5dc8fb7302cc22d8349
This commit is contained in:
Gavin Sharp 2011-09-30 09:51:17 -07:00
parent 29da26def0
commit cc09ca680a
4 changed files with 13 additions and 8 deletions

View File

@ -1159,7 +1159,6 @@ function buildDownloadList(aForceBuild)
gBuilder = setTimeout(function() {
// Start building the list and select the first item
stepListBuilder(1);
gDownloadsView.selectedIndex = 0;
// We just tried to add a single item, so we probably need to enable
updateClearListButton();

View File

@ -166,6 +166,7 @@ function test()
try {
stmt.executeStep();
let richlistbox = doc.getElementById("downloadView");
richlistbox.selectedIndex = 0;
is(stmt.getInt32(0), richlistbox.children.length,
"The database and the number of downloads display matches");
stmt.reset();

View File

@ -176,14 +176,18 @@ function test()
if (aTopic != DLMGR_UI_DONE)
return;
SimpleTest.waitForFocus(function () { sendEnter(aSubject) }, aSubject);
}
};
os.removeObserver(testObs, DLMGR_UI_DONE);
function sendEnter(win) {
// Send the enter key to Download Manager to retry the download
synthesizeKey("VK_ENTER", {}, win);
os.removeObserver(testObs, DLMGR_UI_DONE);
SimpleTest.waitForFocus(function () {
let win = aSubject;
// Down arrow to select the download
synthesizeKey("VK_DOWN", {}, win);
// Enter key to retry the download
synthesizeKey("VK_ENTER", {}, win);
}, aSubject);
}
};
// Register with the observer service

View File

@ -171,6 +171,7 @@ function test()
try {
stmt.executeStep();
let richlistbox = doc.getElementById("downloadView");
richlistbox.selectedIndex = 0;
is(stmt.getInt32(0), richlistbox.children.length,
"The database and the number of downloads display matches");
stmt.reset();