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

Side by Side Diff: chrome/test/data/extensions/api_test/native_messaging/test.js

Issue 12389041: Require manifests for native messaging hosts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 var appName = navigator.platform.match(/win/i) ? 'echo.bat' : 'echo.py'; 5 var appName = 'com.google.chrome.test.echo';
6 6
7 chrome.test.getConfig(function(config) { 7 chrome.test.getConfig(function(config) {
8 chrome.test.runTests([ 8 chrome.test.runTests([
9 9
10 function sendMessageWithCallback() { 10 function sendMessageWithCallback() {
11 var message = {"text": "Hi there!", "number": 3}; 11 var message = {"text": "Hi there!", "number": 3};
12 chrome.runtime.sendNativeMessage( 12 chrome.runtime.sendNativeMessage(
13 appName, message, 13 appName, message,
14 chrome.test.callbackPass(function(nativeResponse) { 14 chrome.test.callbackPass(function(nativeResponse) {
15 var expectedResponse = {"id": 1, "echo": message}; 15 var expectedResponse = {"id": 1, "echo": message};
(...skipping 25 matching lines...) Expand all
41 currentMessage++; 41 currentMessage++;
42 42
43 if (currentMessage == expectedResponses.length) 43 if (currentMessage == expectedResponses.length)
44 chrome.test.notifyPass(); 44 chrome.test.notifyPass();
45 else 45 else
46 port.postMessage(messagesToSend[currentMessage]); 46 port.postMessage(messagesToSend[currentMessage]);
47 }); 47 });
48 } 48 }
49 ]); 49 ]);
50 }); 50 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698