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

Unified Diff: chrome/renderer/resources/extensions/test_custom_bindings.js

Issue 23478003: Check and canonicalize CSS selectors before registering PageStateMatchers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use WebKit::canonicalizeSelector() instead of CSSStyleRule.selectorText Created 7 years, 4 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/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);
+ }
+ }
}
});

Powered by Google App Engine
This is Rietveld 408576698