Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Side by Side Diff: chrome/test/data/extensions/api_test/dial/experimental/discovery.js

Issue 511943004: Don't set lastError if chrome.dial.discoverNow() can't start. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to Wez' comments. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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(typeof(result) == 'boolean');
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 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698