Index: chrome/test/data/extensions/api_test/dial/experimental/discovery.js |
diff --git a/chrome/test/data/extensions/api_test/dial/experimental/discovery.js b/chrome/test/data/extensions/api_test/dial/experimental/discovery.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ee2689cdb6a8d3844c8abf25dd19315a3802b36e |
--- /dev/null |
+++ b/chrome/test/data/extensions/api_test/dial/experimental/discovery.js |
@@ -0,0 +1,32 @@ |
+// Copyright (c) 2012 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 discovery() { |
+ var discoverNowShouldSucceed = function(result) { |
+ if (result) |
+ chrome.test.succeed(); |
+ else |
+ chrome.test.fail(); |
+ }; |
+ |
+ var onDeviceList = function(deviceList) { |
+ // Unused. |
+ }; |
+ |
+ var discoverNowShouldFail = function(result) { |
+ if (!result) { |
+ chrome.test.succeed(); |
+ chrome.dial.onDeviceList.addListener(onDeviceList); |
+ chrome.dial.discoverNow(discoverNowShouldSucceed); |
+ } else { |
+ chrome.test.fail(); |
+ } |
+ }; |
+ |
+ chrome.dial.discoverNow(discoverNowShouldFail); |
+ } |
+ ]); |
+}; |