OLD | NEW |
---|---|
(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 | |
OLD | NEW |