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

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

Issue 2858353002: MediaPerceptionPrivate API impl and testing. (Closed)
Patch Set: Addressed comments and all tests passing. 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(state.status, 'RUNNING');
15 }));
16 },
17 function registerListener() {
18 chrome.test.listenOnce(
19 chrome.mediaPerceptionPrivate.onMediaPerception,
20 function(evt) {
21 chrome.test.assertEq(evt.framePerceptions[0].frameId, 1);
22 });
23 // By sending this message, we trigger the fake D-Bus client to fire an
24 // onMediaPerception event.
25 chrome.test.sendMessage('mediaPerceptionListenerSet');
26 }
27 ]);
28
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698