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

Unified Diff: chrome/test/data/extensions/api_test/hotword_private/hotwordSession/test.js

Issue 267653005: Adds HotwordPrivate API for integrating the hotword feature to AppLauncher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/hotword_private/hotwordSession/test.js
diff --git a/chrome/test/data/extensions/api_test/hotword_private/hotwordSession/test.js b/chrome/test/data/extensions/api_test/hotword_private/hotwordSession/test.js
new file mode 100644
index 0000000000000000000000000000000000000000..7f58b17e5133dafd27b2cf1b026ffe931af9b533
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/hotword_private/hotwordSession/test.js
@@ -0,0 +1,28 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+chrome.test.runTests([
+ function hotwordSessionTest() {
+ chrome.hotwordPrivate.onHotwordSessionRequested.addListener(function () {
+ chrome.hotwordPrivate.setHotwordSessionState(true, function() {
+ chrome.hotwordPrivate.notifyHotwordRecognition('search', function() {
+ chrome.hotwordPrivate.onHotwordSessionStopped.addListener(
+ function() {
+ // Calling setHotwordSessionState and
+ // notifyHotwordRecognition after stopped should be ignored.
+ chrome.hotwordPrivate.setHotwordSessionState(false, function() {
+ chrome.hotwordPrivate.notifyHotwordRecognition(
+ 'search', function() {
+ chrome.test.sendMessage("stopped");
+ chrome.test.succeed();
+ });
+ });
+ });
+ chrome.test.sendMessage("stopReady");
+ });
+ });
+ });
+ chrome.test.sendMessage("ready");
+ }
+]);

Powered by Google App Engine
This is Rietveld 408576698