| OLD | NEW |
| 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 Loading... |
| 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> |
| OLD | NEW |