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"); |
+ } |
+]); |