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 function registerListener() { | |
| 9 chrome.test.listenOnce( | |
| 10 chrome.mediaPerceptionPrivate.onMediaPerception, | |
|
tbarzic
2017/05/09 01:28:36
setState directly causing an event to be dispathed
Luke Sorenson
2017/05/09 21:05:44
Done.
| |
| 11 function(evt) { | |
| 12 chrome.test.assertEq(evt.timestamp, 1); | |
| 13 }); | |
| 14 let kStatusEnum = "RUNNING"; | |
| 15 chrome.mediaPerceptionPrivate.setState( | |
| 16 { status: kStatusEnum }, chrome.test.callbackPass( | |
| 17 function (response) { | |
| 18 chrome.test.assertEq(response.status, kStatusEnum); | |
| 19 })); | |
| 20 } | |
| 21 | |
| 22 // By calling setState, we trigger the fake D-Bus client to fire an | |
| 23 // onMediaPerception event. | |
| 24 chrome.test.runTests([registerListener]); | |
| 25 | |
| OLD | NEW |