OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 onload = function() { | 5 onload = function() { |
6 chrome.test.runTests([ | 6 chrome.test.runTests([ |
7 function discovery() { | 7 function discoverySucceeds() { |
8 var discoverNowShouldFail = function(result) { | 8 var discoverNowCallback = function(result) { |
9 if (!result) { | 9 chrome.test.assertNoLastError(); |
10 chrome.test.succeed(); | 10 // The result may be true or false depending on whether periodic |
11 } else { | 11 // discovery is running at the same time. |
12 chrome.test.fail(); | 12 // TODO(mfoltz): We may want to update the API to distinguish error case s |
13 } | 13 // from simultaneous discovery. |
14 chrome.test.assertTrue(result == true || result == false); | |
Wez
2014/08/28 19:59:52
nit: All we're really asserting, then, is that typ
mark a. foltz
2014/08/28 20:14:50
Yes, that's clearer.
| |
15 chrome.test.succeed(); | |
14 }; | 16 }; |
15 chrome.dial.discoverNow(discoverNowShouldFail); | 17 chrome.dial.onDeviceList.addListener(function(deviceList) {}); |
18 chrome.dial.discoverNow(discoverNowCallback); | |
16 } | 19 } |
17 ]); | 20 ]); |
18 }; | 21 }; |
OLD | NEW |