Chromium Code Reviews| Index: chrome/renderer/resources/extensions/test_custom_bindings.js |
| diff --git a/chrome/renderer/resources/extensions/test_custom_bindings.js b/chrome/renderer/resources/extensions/test_custom_bindings.js |
| index cc2681e8683e3a9be957e7001dc271efdb35ca60..9e0820d14f6554c944593256499370167720cf85 100644 |
| --- a/chrome/renderer/resources/extensions/test_custom_bindings.js |
| +++ b/chrome/renderer/resources/extensions/test_custom_bindings.js |
| @@ -235,8 +235,15 @@ binding.registerCustomHook(function(api) { |
| fn.apply(self, args); |
| chromeTest.fail('Did not throw error: ' + fn); |
| } catch (e) { |
| - if (message !== undefined) |
| - chromeTest.assertEq(message, e.message); |
| + if (e !== failureException && message !== undefined) { |
| + if (typeof(message) == 'object' && |
| + message.constructor.name == 'RegExp') { |
|
not at google - send to devlin
2013/08/29 15:20:25
any reason why you're not using "message instanceo
Jeffrey Yasskin
2013/08/29 21:46:43
Because I don't know JavaScript. Done.
|
| + chromeTest.assertTrue(message.test(e.message), |
| + e.message + ' should match ' + message) |
| + } else { |
| + chromeTest.assertEq(message, e.message); |
| + } |
| + } |
| } |
| }); |