Index: ui/webui/resources/js/webui_resource_test.js |
diff --git a/ui/webui/resources/js/webui_resource_test.js b/ui/webui/resources/js/webui_resource_test.js |
index 2b1660a85d9349b66f89fd1052efbd8da30bc817..5b2f3ebace8cd0a6f2dc8a3984b0b44233b4414c 100644 |
--- a/ui/webui/resources/js/webui_resource_test.js |
+++ b/ui/webui/resources/js/webui_resource_test.js |
@@ -143,8 +143,17 @@ function assertDeepEquals(expected, observed, opt_message) { |
*/ |
function runTests() { |
for (var name in window) { |
- if (typeof window[name] == 'function' && /^test/.test(name)) |
- testCases.push(name); |
+ try { |
+ if (typeof window[name] == 'function' && /^test/.test(name)) |
+ testCases.push(name); |
+ } catch(e) { |
+ if (location.protocol == 'data:' && e.name == 'SecurityError') { |
Dan Beam
2015/07/21 23:37:38
this was fun to track down...
esprehn
2015/07/21 23:42:02
Woah.
|
+ // Sometimes this file gets loaded as a data: URI. That causes issues |
+ // when it touches window.caches or window.cookie. |
+ } else { |
+ throw e; |
+ } |
+ } |
} |
if (!testCases.length) { |
console.error('Failed to find test cases.'); |