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
3 // found in the LICENSE file.
8 function onSessionEstablished(sessionId
, status
, pairingTypes
) {
9 chrome
.test
.assertEq("success", status
);
10 chrome
.test
.assertEq(["embeddedCode"], pairingTypes
);
11 chrome
.gcdPrivate
.startPairing(1234, "pinCode",
12 onPairingStarted
.bind(null));
15 function onPairingStarted(status
) {
16 chrome
.test
.assertEq("unknownSessionError", status
);
17 chrome
.gcdPrivate
.confirmCode(7567, "1234",
18 onCodeConfirmed
.bind(null));
21 function onCodeConfirmed(status
) {
22 chrome
.test
.assertEq("unknownSessionError", status
);
23 chrome
.gcdPrivate
.sendMessage(555, "/privet/ping", {},
27 function onMessageSent(status
, output
) {
28 chrome
.test
.assertEq("unknownSessionError", status
);
29 chrome
.test
.notifyPass();
32 chrome
.gcdPrivate
.createSession("myService._privet._tcp.local",
33 onSessionEstablished
);