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

Unified Diff: chrome/browser/resources/hotword/state_manager.js

Issue 620913003: Add messages on assertions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « chrome/browser/resources/hotword/nacl_manager.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/hotword/state_manager.js
diff --git a/chrome/browser/resources/hotword/state_manager.js b/chrome/browser/resources/hotword/state_manager.js
index 95821d07b42e197e823b6d9dbedf9922f42986ed..1c38b1ad56be81d1980e6aa8c1f848b1e4a8f673 100644
--- a/chrome/browser/resources/hotword/state_manager.js
+++ b/chrome/browser/resources/hotword/state_manager.js
@@ -175,7 +175,7 @@ cr.define('hotword', function() {
* @private
*/
startRecognizer_: function() {
- assert(this.pluginManager_);
+ assert(this.pluginManager_, 'No NaCl plugin loaded');
if (this.state_ != State_.RUNNING) {
this.state_ = State_.RUNNING;
this.pluginManager_.startRecognizer();
@@ -214,7 +214,7 @@ cr.define('hotword', function() {
if (this.state_ != State_.STARTING) {
// At this point, we should not be in the RUNNING state. Doing so would
// imply the hotword detector was started without being ready.
- assert(this.state_ != State_.RUNNING);
+ assert(this.state_ != State_.RUNNING, 'Unexpected RUNNING state');
this.shutdownPluginManager_();
return;
}
@@ -236,7 +236,7 @@ cr.define('hotword', function() {
*/
onTrigger_: function() {
hotword.debug('Hotword triggered!');
- assert(this.pluginManager_);
+ assert(this.pluginManager_, 'No NaCl plugin loaded on trigger');
// Detector implicitly stops when the hotword is detected.
this.state_ = State_.STOPPED;
« no previous file with comments | « chrome/browser/resources/hotword/nacl_manager.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698