Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / chrome / test / data / extensions / api_test / dial / experimental / discovery.js
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 onload = function() {
6   chrome.test.runTests([
7     function discoverySucceeds() {
8       var discoverNowCallback = function(result) {
9         chrome.test.assertNoLastError();
10         // The result may be true or false depending on whether periodic
11         // discovery is running at the same time.
12         // TODO(mfoltz): We may want to update the API to distinguish error cases
13         // from simultaneous discovery.
14         chrome.test.assertTrue(typeof(result) == 'boolean');
15         chrome.test.succeed();
16       };
17       chrome.dial.onDeviceList.addListener(function(deviceList) {});
18       chrome.dial.discoverNow(discoverNowCallback);
19     }
20   ]);
21 };