OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 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 discovery() { |
| 8 var discoverNowShouldSucceed = function(result) { |
| 9 if (result) |
| 10 chrome.test.succeed(); |
| 11 else |
| 12 chrome.test.fail(); |
| 13 }; |
| 14 |
| 15 var onDeviceList = function(deviceList) { |
| 16 // Unused. |
| 17 }; |
| 18 |
| 19 var discoverNowShouldFail = function(result) { |
| 20 if (!result) { |
| 21 chrome.test.succeed(); |
| 22 chrome.dial.onDeviceList.addListener(onDeviceList); |
| 23 chrome.dial.discoverNow(discoverNowShouldSucceed); |
| 24 } else { |
| 25 chrome.test.fail(); |
| 26 } |
| 27 }; |
| 28 |
| 29 chrome.dial.discoverNow(discoverNowShouldFail); |
| 30 } |
| 31 ]); |
| 32 }; |
OLD | NEW |