Chromium Code Reviews| 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 // Set the state to STARTED to automatically start listening to | |
| 6 // MediaPerceptionDetection signals. | |
| 7 | |
| 8 chrome.test.runTests([ | |
| 9 function registerListener() { | |
| 10 // Need to start the mocked media analytics process. | |
| 11 chrome.mediaPerceptionPrivate.setState( | |
|
tbarzic
2017/05/11 00:38:27
same feedback as previous test
Luke Sorenson
2017/05/11 23:57:58
Done.
| |
| 12 { status: 'RUNNING' }, chrome.test.callbackPass(function(state) { | |
| 13 chrome.test.assertEq(state.status, 'RUNNING'); | |
| 14 })); | |
| 15 chrome.test.listenOnce( | |
| 16 chrome.mediaPerceptionPrivate.onMediaPerception, | |
| 17 function(evt) { | |
| 18 chrome.test.assertEq(evt.framePerceptions[0].frameId, 1); | |
| 19 }); | |
| 20 // By sending this message, we trigger the fake D-Bus client to fire an | |
| 21 // onMediaPerception event. | |
| 22 chrome.test.sendMessage('mediaPerceptionListenerSet'); | |
| 23 } | |
| 24 ]); | |
| 25 | |
| OLD | NEW |