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

Side by Side Diff: chrome/test/data/extensions/api_test/media_perception_private/state/runtest.js

Issue 2858353002: MediaPerceptionPrivate API impl and testing. (Closed)
Patch Set: Addressing comments on API implementation. Created 3 years, 7 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
(Empty)
1 // Copyright 2017 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 let kStatusEnum = 'RUNNING'
6 let state = { status: kStatusEnum }
7
8 function setState() {
9 chrome.mediaPerceptionPrivate.setState(
10 state, chrome.test.callback(stateCallback));
11 }
12
13 function getState() {
14 chrome.mediaPerceptionPrivate.getState(
15 chrome.test.callback(stateCallback));
16 }
17
18 function setStateUnsettable() {
19 state.status = 'UNINITIALIZED'
20 const error = 'Settable statuses are RUNNING and SUSPENDED.'
21 chrome.mediaPerceptionPrivate.setState(state, fail(error));
22 }
23
24 function stateCallback(response) {
25 chrome.test.assertEq(response.status, kStatusEnum);
tbarzic 2017/05/09 01:28:36 I don't think it's worth having this as a separate
Luke Sorenson 2017/05/09 21:05:44 Done. Fine with getting rid of the callback method
tbarzic 2017/05/09 21:19:14 yes, but a couple should be OK to inline
Luke Sorenson 2017/05/10 18:50:16 I've got more than a couple now :)
tbarzic 2017/05/11 00:38:26 still, not too many - I find the inlined version e
Luke Sorenson 2017/05/11 23:57:58 Acknowledged.
26 }
27
28 chrome.test.runTests([setState, getState]);
29
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698