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

Unified Diff: chrome/test/data/extensions/api_test/gcd_private/api/wifi_message.js

Issue 434733003: Added function to get list of networks with prefetched passwords. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Thu 07/31/2014 14:34:51.93 Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/gcd_private/api/wifi_message.js
diff --git a/chrome/test/data/extensions/api_test/gcd_private/api/wifi_message.js b/chrome/test/data/extensions/api_test/gcd_private/api/wifi_message.js
new file mode 100644
index 0000000000000000000000000000000000000000..bdec7dc498e39b8d9d424fee8bd3859c0c0ddbdf
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/gcd_private/api/wifi_message.js
@@ -0,0 +1,51 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+onload = function() {
+ chrome.test.runTests([
+ function wifiMessage() {
+ var messages_needed = 3;
+ function onConfirmCode(sessionId, status, code, method) {
+ chrome.test.assertEq("success", status);
+ chrome.test.assertEq("01234", code);
+ chrome.gcdPrivate.confirmCode(sessionId,
+ onSessionEstablished.bind(null,
+ sessionId));
+ }
+
+ function onSessionEstablished(sessionId, status) {
+ chrome.test.assertEq("success", status);
+
+ chrome.gcdPrivate.sendMessage(sessionId, "/privet/v3/setup/start", {
+ "wifi" : {
+ }
+ }, onMessageSent.bind(null, "setupParseError"));
+
+ chrome.gcdPrivate.sendMessage(sessionId, "/privet/v3/setup/start", {
+ "wifi" : {
+ "passphrase": "Blah"
+ }
+ }, onMessageSent.bind(null, "setupParseError"));
+
+ chrome.gcdPrivate.sendMessage(sessionId, "/privet/v3/setup/start", {
+ "wifi" : {
+ "ssid": "Blah"
+ }
+ }, onMessageSent.bind(null, "wifiPasswordError"));
+ }
+
+ function onMessageSent(expected_status, status, output) {
+ chrome.test.assertEq(expected_status, status);
+ messages_needed--;
+ console.log("Messages needed " + messages_needed);
+
+ if (messages_needed == 0) {
+ chrome.test.notifyPass();
+ }
+ }
+
+ chrome.gcdPrivate.establishSession("1.2.3.4", 9090, onConfirmCode);
+ }
+ ]);
+};

Powered by Google App Engine
This is Rietveld 408576698