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

Side by Side Diff: chrome/test/data/extensions/api_test/gcd_private/api/session.js

Issue 468613003: API change to allow sticker authentication for devices (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 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 onConfirmCode(sessionId, status, code, method) { 8 function onConfirmCode(sessionId, status, code, method) {
9 chrome.test.assertEq("success", status); 9 chrome.test.assertEq("success", status);
10 chrome.test.assertEq("01234", code); 10 chrome.test.assertEq("01234", code);
11 chrome.gcdPrivate.confirmCode(sessionId, 11 chrome.gcdPrivate.confirmCode(sessionId,
12 "01234",
12 onSessionEstablished.bind(null, 13 onSessionEstablished.bind(null,
13 sessionId)); 14 sessionId));
14 } 15 }
15 16
16 function onSessionEstablished(sessionId, status) { 17 function onSessionEstablished(sessionId, status) {
17 chrome.test.assertEq("success", status); 18 chrome.test.assertEq("success", status);
18 19
19 chrome.gcdPrivate.sendMessage(sessionId, "/privet/ping", {}, 20 chrome.gcdPrivate.sendMessage(sessionId, "/privet/ping", {},
20 onMessageSent); 21 onMessageSent);
21 } 22 }
22 23
23 function onMessageSent(status, output) { 24 function onMessageSent(status, output) {
24 chrome.test.assertEq("success", status); 25 chrome.test.assertEq("success", status);
25 chrome.test.assertEq("pong", output.response); 26 chrome.test.assertEq("pong", output.response);
26 27
27 chrome.test.notifyPass(); 28 chrome.test.notifyPass();
28 } 29 }
29 30
30 chrome.gcdPrivate.establishSession("1.2.3.4", 9090, onConfirmCode); 31 chrome.gcdPrivate.establishSession("1.2.3.4", 9090, onConfirmCode);
31 } 32 }
32 ]); 33 ]);
33 }; 34 };
OLDNEW
« chrome/common/extensions/api/gcd_private.idl ('K') | « chrome/common/extensions/api/gcd_private.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698