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

Unified Diff: chrome/test/data/extensions/api_test/messaging/connect/test.html

Issue 2387002: Prevent extensions from clobbering JSON implementation that extension calls use (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: arv cr changes Created 10 years, 7 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/test/data/extensions/api_test/messaging/connect/test.html
diff --git a/chrome/test/data/extensions/api_test/messaging/connect/test.html b/chrome/test/data/extensions/api_test/messaging/connect/test.html
index 3e249165cd5dc28dc87d90caf103041581051885..4983a751daecd4dd587765cb03010b0091c46d7f 100644
--- a/chrome/test/data/extensions/api_test/messaging/connect/test.html
+++ b/chrome/test/data/extensions/api_test/messaging/connect/test.html
@@ -1,4 +1,20 @@
<script>
+JSON.parse = function() {
+ return "JSON.parse clobbered by extension.";
+}
+
+JSON.stringify = function() {
+ return "JSON.stringify clobbered by extension.";
+}
+
+Array.prototype.toJSON = function() {
+ return "Array.prototype.toJSON clobbered by extension.";
+}
+
+Object.prototype.toJSON = function() {
+ return "Object.prototype.toJSON clobbered by extension.";
+}
+
// Keep track of the tab that we're running tests in, for simplicity.
var testTab = null;

Powered by Google App Engine
This is Rietveld 408576698