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

Unified Diff: extensions/renderer/api_test_base.cc

Issue 1417513003: [Extensions] Don't allow built-in extensions code to be overridden (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Jochen's Created 5 years, 2 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: extensions/renderer/api_test_base.cc
diff --git a/extensions/renderer/api_test_base.cc b/extensions/renderer/api_test_base.cc
index 53d6fa4923870a17efc05f602f84e20bca28d6ad..03158926eb457c05f35dc9c5c9e1f4ce21425722 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(),
« no previous file with comments | « chrome/test/data/extensions/api_test/bindings/override_exports.html ('k') | extensions/renderer/event_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698