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 |
index 917462c41ce488ca7ee30b460dc56aa49047dba2..04f873dac0a5906a1a2f85f181c9fb5d41e42e70 100644 |
--- a/chrome/test/data/extensions/api_test/dial/experimental/discovery.js |
+++ b/chrome/test/data/extensions/api_test/dial/experimental/discovery.js |
@@ -1,18 +1,21 @@ |
-// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Copyright (c) 2014 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 discoverNowShouldFail = function(result) { |
- if (!result) { |
- chrome.test.succeed(); |
- } else { |
- chrome.test.fail(); |
- } |
+ function discoverySucceeds() { |
+ var discoverNowCallback = function(result) { |
+ chrome.test.assertNoLastError(); |
+ // The result may be true or false depending on whether periodic |
+ // discovery is running at the same time. |
+ // TODO(mfoltz): We may want to update the API to distinguish error cases |
+ // from simultaneous discovery. |
+ 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.
|
+ chrome.test.succeed(); |
}; |
- chrome.dial.discoverNow(discoverNowShouldFail); |
+ chrome.dial.onDeviceList.addListener(function(deviceList) {}); |
+ chrome.dial.discoverNow(discoverNowCallback); |
} |
]); |
}; |