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

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

Issue 597313002: GCD Private API: Change hardcoded code to 4 digits not 5. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test 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
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, confirmationInfo) { 8 function onConfirmCode(sessionId, status, confirmationInfo) {
9 chrome.test.assertEq("success", status); 9 chrome.test.assertEq("success", status);
10 chrome.test.assertEq("01234", confirmationInfo.code); 10 chrome.test.assertEq("1234", confirmationInfo.code);
11 chrome.test.assertEq("displayCode", confirmationInfo.type); 11 chrome.test.assertEq("displayCode", confirmationInfo.type);
12 12
13 chrome.gcdPrivate.confirmCode(sessionId, 13 chrome.gcdPrivate.confirmCode(sessionId,
14 "01234", 14 "1234",
15 onSessionEstablished.bind(null, 15 onSessionEstablished.bind(null,
16 sessionId)); 16 sessionId));
17 } 17 }
18 18
19 function onSessionEstablished(sessionId, status) { 19 function onSessionEstablished(sessionId, status) {
20 chrome.test.assertEq("success", status); 20 chrome.test.assertEq("success", status);
21 21
22 chrome.gcdPrivate.sendMessage(sessionId, "/privet/ping", {}, 22 chrome.gcdPrivate.sendMessage(sessionId, "/privet/ping", {},
23 onMessageSent); 23 onMessageSent);
24 } 24 }
25 25
26 function onMessageSent(status, output) { 26 function onMessageSent(status, output) {
27 chrome.test.assertEq("success", status); 27 chrome.test.assertEq("success", status);
28 chrome.test.assertEq("pong", output.response); 28 chrome.test.assertEq("pong", output.response);
29 29
30 chrome.test.notifyPass(); 30 chrome.test.notifyPass();
31 } 31 }
32 32
33 chrome.gcdPrivate.establishSession("1.2.3.4", 9090, onConfirmCode); 33 chrome.gcdPrivate.establishSession("1.2.3.4", 9090, onConfirmCode);
34 } 34 }
35 ]); 35 ]);
36 }; 36 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698