| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 JSON.parse = function() { | 5 JSON.parse = function() { |
| 6 return "JSON.parse clobbered by content script."; | 6 return "JSON.parse clobbered by content script."; |
| 7 }; | 7 }; |
| 8 | 8 |
| 9 JSON.stringify = function() { | 9 JSON.stringify = function() { |
| 10 return "JSON.stringify clobbered by content script."; | 10 return "JSON.stringify clobbered by content script."; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 function testConnectFromTabError() { | 78 function testConnectFromTabError() { |
| 79 var port = chrome.runtime.connect("bad-extension-id"); | 79 var port = chrome.runtime.connect("bad-extension-id"); |
| 80 port.onDisconnect.addListener(function() { | 80 port.onDisconnect.addListener(function() { |
| 81 var success = (chrome.runtime.lastError ? true : false); | 81 var success = (chrome.runtime.lastError ? true : false); |
| 82 chrome.runtime.sendMessage({success: success}); | 82 chrome.runtime.sendMessage({success: success}); |
| 83 }); | 83 }); |
| 84 } | 84 } |
| 85 | 85 |
| 86 // For test sendMessage. | 86 // For test sendMessage. |
| 87 chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) { | 87 chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) { |
| 88 chrome.test.assertEq({id: chrome.runtime.id}, sender); |
| 88 sendResponse({success: (request.step2 == 1)}); | 89 sendResponse({success: (request.step2 == 1)}); |
| 89 }); | 90 }); |
| OLD | NEW |