summaryrefslogtreecommitdiffstats
path: root/extensions/renderer/api_test_base.cc
diff options
context:
space:
mode:
authorrdevlin.cronin <rdevlin.cronin@chromium.org>2015-10-28 14:43:58 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-28 21:44:52 +0000
commit83a4b3aa72d98fe4176b4a54c8cea227ed966570 (patch)
treeb945cea0a7bd5e5b25a3ff9a6a8be834adf0b84b /extensions/renderer/api_test_base.cc
parent6d9425ec7badda912555d46ea7abcfab81fdd9b9 (diff)
downloadchromium_src-83a4b3aa72d98fe4176b4a54c8cea227ed966570.zip
chromium_src-83a4b3aa72d98fe4176b4a54c8cea227ed966570.tar.gz
chromium_src-83a4b3aa72d98fe4176b4a54c8cea227ed966570.tar.bz2
[Extensions] Don't allow built-in extensions code to be overridden
BUG=546677 Review URL: https://codereview.chromium.org/1417513003 Cr-Commit-Position: refs/heads/master@{#356654}
Diffstat (limited to 'extensions/renderer/api_test_base.cc')
-rw-r--r--extensions/renderer/api_test_base.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/extensions/renderer/api_test_base.cc b/extensions/renderer/api_test_base.cc
index 53d6fa4..0315892 100644
--- a/extensions/renderer/api_test_base.cc
+++ b/extensions/renderer/api_test_base.cc
@@ -140,17 +140,18 @@ void ApiTestEnvironment::RegisterModules() {
"unit_test_environment_specific_bindings.js");
env()->OverrideNativeHandler("activityLogger",
- "exports.LogAPICall = function() {};");
+ "exports.$set('LogAPICall', function() {});");
env()->OverrideNativeHandler(
"apiDefinitions",
- "exports.GetExtensionAPIDefinitionsForTest = function() { return [] };");
+ "exports.$set('GetExtensionAPIDefinitionsForTest',"
+ "function() { return [] });");
env()->OverrideNativeHandler(
"event_natives",
- "exports.AttachEvent = function() {};"
- "exports.DetachEvent = function() {};"
- "exports.AttachFilteredEvent = function() {};"
- "exports.AttachFilteredEvent = function() {};"
- "exports.MatchAgainstEventFilter = function() { return [] };");
+ "exports.$set('AttachEvent', function() {});"
+ "exports.$set('DetachEvent', function() {});"
+ "exports.$set('AttachFilteredEvent', function() {});"
+ "exports.$set('AttachFilteredEvent', function() {});"
+ "exports.$set('MatchAgainstEventFilter', function() { return [] });");
gin::ModuleRegistry::From(env()->context()->v8_context())
->AddBuiltinModule(env()->isolate(),