1 // Copyright 2014 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.
6 function hotwordSessionTest() {
7 chrome.hotwordPrivate.onHotwordSessionRequested.addListener(function () {
8 chrome.hotwordPrivate.setHotwordSessionState(true, function() {
9 chrome.hotwordPrivate.notifyHotwordRecognition('search', function() {
10 chrome.hotwordPrivate.onHotwordSessionStopped.addListener(
12 // Calling setHotwordSessionState and
13 // notifyHotwordRecognition after stopped should be ignored.
14 chrome.hotwordPrivate.setHotwordSessionState(false, function() {
15 chrome.hotwordPrivate.notifyHotwordRecognition(
16 'search', function() {
17 chrome.test.sendMessage("stopped");
18 chrome.test.succeed();
22 chrome.test.sendMessage("stopReady");
26 chrome.test.sendMessage("ready");