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

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

Issue 2754014: Merge 48667 - Prevent extensions from clobbering JSON implementation that ext... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/375/src/
Patch Set: Created 10 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/data/extensions/api_test/messaging/connect/page.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <script> 1 <script>
2 JSON.parse = function() {
3 return "JSON.parse clobbered by extension.";
4 }
5
6 JSON.stringify = function() {
7 return "JSON.stringify clobbered by extension.";
8 }
9
10 Array.prototype.toJSON = function() {
11 return "Array.prototype.toJSON clobbered by extension.";
12 }
13
14 Object.prototype.toJSON = function() {
15 return "Object.prototype.toJSON clobbered by extension.";
16 }
17
2 // Keep track of the tab that we're running tests in, for simplicity. 18 // Keep track of the tab that we're running tests in, for simplicity.
3 var testTab = null; 19 var testTab = null;
4 20
5 chrome.test.runTests([ 21 chrome.test.runTests([
6 function setupTestTab() { 22 function setupTestTab() {
7 chrome.test.log("Creating tab..."); 23 chrome.test.log("Creating tab...");
8 chrome.tabs.create({ 24 chrome.tabs.create({
9 url: "http://localhost:1337/files/extensions/test_file.html" 25 url: "http://localhost:1337/files/extensions/test_file.html"
10 }, function(tab) { 26 }, function(tab) {
11 chrome.tabs.onUpdated.addListener(function listener(tabid, info) { 27 chrome.tabs.onUpdated.addListener(function listener(tabid, info) {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 var port = chrome.tabs.connect(testTab.id); 122 var port = chrome.tabs.connect(testTab.id);
107 port.postMessage({testDisconnectOnClose: true}); 123 port.postMessage({testDisconnectOnClose: true});
108 port.onDisconnect.addListener(function() { 124 port.onDisconnect.addListener(function() {
109 chrome.test.succeed(); 125 chrome.test.succeed();
110 testTab = null; // the tab is about:blank now. 126 testTab = null; // the tab is about:blank now.
111 }); 127 });
112 }, 128 },
113 ]); 129 ]);
114 130
115 </script> 131 </script>
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/messaging/connect/page.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698