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

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

Issue 2791983004: DBus MediaAnalyticsClient and media_perception pb. (Closed)
Patch Set: Upstart process management Created 3 years, 8 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 // Set the state to STARTED to automatically start listening to
6 // MediaPerceptionDetection signals.
7 let statusEnum = "STARTED"
tbarzic 2017/04/27 20:37:35 I'd inline these.
Luke Sorenson 2017/05/03 23:56:06 Done.
8 let state = { status: statusEnum }
9
10 function setState() {
11 chrome.mediaPerceptionPrivate.setState(
12 state, chrome.test.callback(stateCallback));
tbarzic 2017/04/27 20:37:35 chrome.test.callbackPass instead of chrome.test.ca
Luke Sorenson 2017/05/03 23:56:06 Done.
13 }
14
15 function stateCallback(response) {
tbarzic 2017/04/27 20:37:35 can you inline this?
Luke Sorenson 2017/05/03 23:56:06 Done.
16 chrome.test.assertEq(response.status, statusEnum);
17 }
18
19 function registerListener() {
20 chrome.mediaPerceptionPrivate.onMediaPerception.addListener(
21 function(response) {
tbarzic 2017/04/27 20:37:35 You can do this as: chrome.test.listenOnce( ch
Luke Sorenson 2017/05/03 23:56:06 Done.
22 chrome.test.assertEq(response.timestamp, 1);
23 chrome.test.succeed();
24 });
25 chrome.test.notifyPass();
26 }
27
28 chrome.test.runTests([setState, registerListener]);
29
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698