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

Side by Side Diff: chrome/test/data/extensions/api_test/window_open/argument_overflow/test.js

Issue 2947223003: [Extensions Bindings] Consider argument type more in signature parsing (Closed)
Patch Set: . Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 function check_overflow_check(value) { 5 function check_overflow_check(value) {
6 try { 6 try {
7 chrome.windows.create({ "left": value }, function() { }); 7 chrome.windows.create({ "left": value }, function() { });
8 } catch (e) { 8 } catch (e) {
9 chrome.test.assertTrue(e.message.indexOf( 9 var jsBindingsError = 'Value must fit in a 32-bit signed integer.';
10 "Value must fit in a 32-bit signed integer.") != -1); 10 var nativeBindingsError = 'Invalid type: expected integer, found number.';
Devlin 2017/06/21 23:07:39 Concretely, this CL changes the error from: Error
11 chrome.test.assertTrue(
12 e.message.indexOf(jsBindingsError) != -1 ||
13 e.message.indexOf(nativeBindingsError) != -1,
14 e.message);
11 chrome.test.succeed(); 15 chrome.test.succeed();
12 return; 16 return;
13 } 17 }
14 } 18 }
15 chrome.test.runTests([ 19 chrome.test.runTests([
16 function overflow2To31() { check_overflow_check(0x80000000); }, 20 function overflow2To31() { check_overflow_check(0x80000000); },
17 function overflowMinus2To31Minus1() { check_overflow_check(-0x80000001); }, 21 function overflowMinus2To31Minus1() { check_overflow_check(-0x80000001); },
18 function overflow2To32() { check_overflow_check(0x100000000); }, 22 function overflow2To32() { check_overflow_check(0x100000000); },
19 ]); 23 ]);
OLDNEW
« no previous file with comments | « no previous file | extensions/renderer/api_signature.cc » ('j') | extensions/renderer/argument_spec.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698