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(); |