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

Unified Diff: chrome/test/data/extensions/api_test/dial/experimental/network_id_changed.js

Issue 2750453002: Add DiscoveryNetworkMonitor implementation (Closed)
Patch Set: Respond to mfoltz' comments, add chrome.dial API back with tests Created 3 years, 8 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/dial/experimental/network_id_changed.js
diff --git a/chrome/test/data/extensions/api_test/dial/experimental/network_id_changed.js b/chrome/test/data/extensions/api_test/dial/experimental/network_id_changed.js
new file mode 100644
index 0000000000000000000000000000000000000000..559aced1cc3677a7a92d68180ab133fec941e2e4
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/dial/experimental/network_id_changed.js
@@ -0,0 +1,19 @@
+// Copyright (c) 2017 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.
+
+let networkIds = [];
+
+chrome.dial.onNetworkIdChanged.addListener(networkId => {
+ chrome.test.assertFalse(networkId == "disconnected");
+ chrome.test.assertFalse(networkId == "unknown");
+ networkIds.push(networkId);
+ chrome.test.sendMessage("continue");
+
+ if (networkIds.length == 2) {
+ chrome.test.assertFalse(networkIds[0] == networkIds[1]);
+ chrome.test.succeed();
+ }
+});
+
+chrome.test.notifyPass();

Powered by Google App Engine
This is Rietveld 408576698