| 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..429b9d1c17a43a6a99e603a43fc4ef381f6c09e2 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(typeof(result) == 'boolean');
|
| + chrome.test.succeed();
|
| };
|
| - chrome.dial.discoverNow(discoverNowShouldFail);
|
| + chrome.dial.onDeviceList.addListener(function(deviceList) {});
|
| + chrome.dial.discoverNow(discoverNowCallback);
|
| }
|
| ]);
|
| };
|
|
|