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

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

Issue 2858353002: MediaPerceptionPrivate API impl and testing. (Closed)
Patch Set: Added media_perception_proto as direct dependency of test targets. 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 // Set the state to STARTED to automatically start listening to
6 // MediaPerceptionDetection signals.
7
8 chrome.test.runTests([
9 function setStateRunning() {
10 // Need to start the mocked media analytics process.
11 chrome.mediaPerceptionPrivate.setState({
12 status: 'RUNNING'
13 }, chrome.test.callbackPass(function(state) {
14 chrome.test.assertEq({ status: 'RUNNING' }, state);
15 }));
16 },
17 function registerListener() {
18 chrome.test.listenOnce(
19 chrome.mediaPerceptionPrivate.onMediaPerception,
20 function(evt) {
21 chrome.test.assertEq({
22 framePerceptions: [{
23 frameId: 1
24 }]
25 }, evt);
26 });
27 // By sending this message, we trigger the fake D-Bus client to fire an
28 // onMediaPerception event.
29 chrome.test.sendMessage('mediaPerceptionListenerSet');
30 }
31 ]);
32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698