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

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

Issue 7787004: Fix crash when calling chrome.tabs.move({index:-1}). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 3 months 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
« no previous file with comments | « chrome/renderer/resources/json_schema.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/tabs/basics/move.html
diff --git a/chrome/test/data/extensions/api_test/tabs/basics/move.html b/chrome/test/data/extensions/api_test/tabs/basics/move.html
index 9df94f4ae7e74c8b6192e24fac1ea07835ed8bbb..55eb71b1e23cb8c82e7936efa0f8b1d6d7a150d4 100644
--- a/chrome/test/data/extensions/api_test/tabs/basics/move.html
+++ b/chrome/test/data/extensions/api_test/tabs/basics/move.html
@@ -80,6 +80,22 @@ chrome.test.runTests([
assertEq("chrome://newtab/", tabs[1].url);
}));
}));
+ },
+
+ // Make sure we don't crash when the index is out of range.
+ function moveToInvalidTab() {
+ var error_msg = "Invalid value for argument 2. Property 'index': " +
+ "Value must not be less than 0.";
+ try {
+ chrome.tabs.move(moveTabIds['b'], {index: -1}, function(tab) {
+ chrome.test.fail("Moved a tab to an invalid index");
+ });
+ } catch (e) {
+ assertEq(error_msg, e.message);
+ }
+ chrome.tabs.move(moveTabIds['b'], {index: 10000}, pass(function(tabB) {
+ assertEq(1, tabB.index);
+ }));
}
]);
</script>
« no previous file with comments | « chrome/renderer/resources/json_schema.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698