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

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

Issue 2901403003: [Extensions Bindings] Update tabs tests to accept new error messages (Closed)
Patch Set: Created 3 years, 7 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
Index: chrome/test/data/extensions/api_test/tabs/basics/move.js
diff --git a/chrome/test/data/extensions/api_test/tabs/basics/move.js b/chrome/test/data/extensions/api_test/tabs/basics/move.js
index 25d119e91829fc6e98862b0df326d3fecb23ebe8..3bec82b67f62e061a3bfaebb4232d6dae5f7814a 100644
--- a/chrome/test/data/extensions/api_test/tabs/basics/move.js
+++ b/chrome/test/data/extensions/api_test/tabs/basics/move.js
@@ -142,15 +142,25 @@ chrome.test.runTests([
// 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 -1.";
+ var jsBindingsError =
+ 'Invalid value for argument 2. Property \'index\': ' +
+ 'Value must not be less than -1.';
+ var nativeBindingsError =
+ 'Error in invocation of tabs.move(' +
+ '[integer|array] tabIds, object moveProperties, ' +
+ 'optional function callback): Error at parameter \'moveProperties\': ' +
+ 'Error at property \'index\': Value must be at least -1.';
+ var caught = false;
try {
chrome.tabs.move(moveTabIds['b'], {"index": -2}, function(tab) {
chrome.test.fail("Moved a tab to an invalid index");
});
} catch (e) {
- assertEq(error_msg, e.message);
+ assertTrue(e.message == jsBindingsError ||
+ e.message == nativeBindingsError, e.message);
+ caught = true;
}
+ assertTrue(caught);
chrome.tabs.move(moveTabIds['b'], {"index": 10000}, pass(function(tabB) {
assertEq(2, tabB.index);
}));

Powered by Google App Engine
This is Rietveld 408576698