Commit c3aab70b authored by dbeam@chromium.org's avatar dbeam@chromium.org

Small crash fix for set pages dialog drag'n'drop issue.

R=thakis@chromium.org
BUG=302284

Review URL: https://codereview.chromium.org/52823006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232971 0039d316-1c4b-4281-b951-d872f2087c98
parent 57a3d8aa
...@@ -96,7 +96,7 @@ void CustomHomePagesTableModel::SetURLs(const std::vector<GURL>& urls) { ...@@ -96,7 +96,7 @@ void CustomHomePagesTableModel::SetURLs(const std::vector<GURL>& urls) {
*/ */
void CustomHomePagesTableModel::MoveURLs(int insert_before, void CustomHomePagesTableModel::MoveURLs(int insert_before,
const std::vector<int>& index_list) { const std::vector<int>& index_list) {
DCHECK(!index_list.empty()); if (index_list.empty()) return;
DCHECK(insert_before >= 0 && insert_before <= RowCount()); DCHECK(insert_before >= 0 && insert_before <= RowCount());
// The range of elements that needs to be reshuffled is [ |first|, |last| ). // The range of elements that needs to be reshuffled is [ |first|, |last| ).
......
...@@ -271,6 +271,12 @@ TEST_F('OptionsWebUITest', 'EnterPreventsDefault', function() { ...@@ -271,6 +271,12 @@ TEST_F('OptionsWebUITest', 'EnterPreventsDefault', function() {
testDone(); testDone();
}); });
// Verifies that sending an empty list of indexes to move doesn't crash chrome.
TEST_F('OptionsWebUITest', 'emptySelectedIndexesDoesntCrash', function() {
chrome.send('dragDropStartupPage', [0, []]);
setTimeout(testDone);
});
/** /**
* TestFixture for OptionsPage WebUI testing including tab history and support * TestFixture for OptionsPage WebUI testing including tab history and support
* for preference manipulation. * for preference manipulation.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment