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

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

Issue 14301016: Fix a couple of bugs relating to sending Tab info with chrome.runtime.connect and (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add key to app1/manifest.json Created 7 years, 8 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
OLDNEW
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
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 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698