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

Unified Diff: extensions/test/data/api_test/audio/output_mute_change/background.js

Issue 2462833002: Refactor audio API tests (Closed)
Patch Set: Refactor audio API tests Created 4 years, 1 month 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: extensions/test/data/api_test/audio/output_mute_change/background.js
diff --git a/extensions/test/data/api_test/audio/output_mute_change/background.js b/extensions/test/data/api_test/audio/output_mute_change/background.js
index 2a4d60a201f9e97c10b8fd7f7800b01391c65dbf..73b13572cf6b00e28b39e0af9b152f01c7139480 100644
--- a/extensions/test/data/api_test/audio/output_mute_change/background.js
+++ b/extensions/test/data/api_test/audio/output_mute_change/background.js
@@ -2,13 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-chrome.audio.OnMuteChanged.addListener(function (is_input, is_muted) {
- if (is_input === false && is_muted === false) {
- chrome.test.sendMessage("success");
- } else {
- console.error("Got unexpected OnMuteChanged event is_input:" + is_input +
- " is_muted:" + is_muted);
- chrome.test.sendMessage("failure");
+chrome.test.runTests([
+ function waitForMuteChangedEventTests() {
+ chrome.test.listenOnce(
+ chrome.audio.OnMuteChanged,
+ function(isInput, isMuted) {
+ chrome.test.assertFalse(isInput);
+ chrome.test.assertFalse(isMuted);
+ });
}
-});
-chrome.test.sendMessage("loaded");
+]);
+
+chrome.test.sendMessage('loaded');

Powered by Google App Engine
This is Rietveld 408576698