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

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

Issue 591463003: Remote Assistance on Chrome OS Part III - NativeMessageHost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@native_messaging
Patch Set: Fix NativeMessagingBasic test on Release builds Created 6 years, 2 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
« no previous file with comments | « chrome/chrome_browser_extensions.gypi ('k') | extensions/browser/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 = 'com.google.chrome.test.echo'; 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 function invalidHostName() { 9 function invalidHostName() {
10 var message = {"text": "Hello!"}; 10 var message = {"text": "Hello!"};
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 chrome.test.succeed(); 80 chrome.test.succeed();
81 else 81 else
82 port.postMessage(messagesToSend[currentMessage]); 82 port.postMessage(messagesToSend[currentMessage]);
83 }); 83 });
84 }, 84 },
85 85
86 // Verify that the case when host stops itself is handled properly. 86 // Verify that the case when host stops itself is handled properly.
87 function stopHost() { 87 function stopHost() {
88 port = chrome.extension.connectNative(appName); 88 port = chrome.extension.connectNative(appName);
89 89
90 port.onMessage.addListener(function(message) { 90 port.onDisconnect.addListener(
91 port.onDisconnect.addListener(chrome.test.callback( 91 chrome.test.callback(function() {}, "Native host has exited."));
92 function() {},
93 "Native host has exited."));
94 });
95 92
96 // Send first message that should stop the host. 93 // Send first message that should stop the host.
97 port.postMessage({ "stopHostTest": true }); 94 port.postMessage({ "stopHostTest": true });
98 } 95 }
99 ]); 96 ]);
100 }); 97 });
OLDNEW
« no previous file with comments | « chrome/chrome_browser_extensions.gypi ('k') | extensions/browser/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698