| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 onload = function() { | 5 onload = function() { |
| 6 chrome.test.runTests([ | 6 chrome.test.runTests([ |
| 7 function session() { | 7 function session() { |
| 8 function onSessionEstablished(sessionId, status, pairingTypes) { | 8 function onSessionEstablished(sessionId, status, pairingTypes) { |
| 9 chrome.test.assertEq("success", status); | 9 chrome.test.assertEq("success", status); |
| 10 chrome.test.assertEq(["embeddedCode"], pairingTypes); | 10 chrome.test.assertEq(["embeddedCode"], pairingTypes); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 chrome.test.assertEq("unknownSessionError", status); | 22 chrome.test.assertEq("unknownSessionError", status); |
| 23 chrome.gcdPrivate.sendMessage(555, "/privet/ping", {}, | 23 chrome.gcdPrivate.sendMessage(555, "/privet/ping", {}, |
| 24 onMessageSent); | 24 onMessageSent); |
| 25 } | 25 } |
| 26 | 26 |
| 27 function onMessageSent(status, output) { | 27 function onMessageSent(status, output) { |
| 28 chrome.test.assertEq("unknownSessionError", status); | 28 chrome.test.assertEq("unknownSessionError", status); |
| 29 chrome.test.notifyPass(); | 29 chrome.test.notifyPass(); |
| 30 } | 30 } |
| 31 | 31 |
| 32 chrome.gcdPrivate.establishSession("1.2.3.4", 9090, onSessionEstablished); | 32 chrome.gcdPrivate.createSession("myService._privet._tcp.local", |
| 33 onSessionEstablished); |
| 33 } | 34 } |
| 34 ]); | 35 ]); |
| 35 }; | 36 }; |
| OLD | NEW |