Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 ]); |
| OLD | NEW |