Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / test / data / extensions / api_test / gcd_private / api / session.js
blobdcbe90c8931fc524fdd6eae6be7c112e64735071
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.
5 onload = function() {
6 chrome.test.runTests([
7 function session() {
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", {},
24 onMessageSent);
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);
35 ]);