Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7106)

Unified Diff: chrome/test/data/extensions/api_test/tabs/basics/move.html

Issue 5018002: Fixes a crash when entering a negative index with chrome.tabs.move .... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/tabs/basics/move.html
===================================================================
--- chrome/test/data/extensions/api_test/tabs/basics/move.html (revision 65777)
+++ chrome/test/data/extensions/api_test/tabs/basics/move.html (working copy)
@@ -69,6 +69,25 @@
}));
}));
}));
+
+ // Check that the browser doesn't segfault on a negative index
+ // or an out of range integer (BUG=53990).
+ chrome.tabs.getAllInWindow(firstWindowId, pass(function(tabs) {
+ lastTab = tabs.pop()
+ try {
+ chrome.tabs.move(lastTab.id, {'windowId': firstWindowId, 'index': -1});
+ }
+ catch(err) {
+ // Always generates an exception, but it doesn't need to be handled
+ // because it's tested in js_schema_test.js.
+ }
+ try {
+ chrome.tabs.move(lastTab.id,{'index':1E10});
+ }
+ catch(err) {
+ // Also doesn't need to be handled.
+ }
+ }));
},
function remove() {

Powered by Google App Engine
This is Rietveld 408576698