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

Unified Diff: extensions/test/data/api_test/audio/volume_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
« no previous file with comments | « extensions/test/data/api_test/audio/test.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/test/data/api_test/audio/volume_change/background.js
diff --git a/extensions/test/data/api_test/audio/volume_change/background.js b/extensions/test/data/api_test/audio/volume_change/background.js
index 952f96c4e810e0829d44f0f019222f980a847e2a..7c6a845c9192bf1ff248562b22f7139f3ce264f6 100644
--- a/extensions/test/data/api_test/audio/volume_change/background.js
+++ b/extensions/test/data/api_test/audio/volume_change/background.js
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-chrome.audio.OnLevelChanged.addListener(function (id, level) {
- if (id == 30001 && level == 60) {
- chrome.test.sendMessage("success");
- } else {
- console.error("Got unexpected OnLevelChanged event id:" + id +
- " level:" + level);
- chrome.test.sendMessage("failure");
+chrome.test.runTests([
+ function waitForLevelChangedEventTests() {
+ chrome.test.listenOnce(chrome.audio.OnLevelChanged, function (id, level) {
+ chrome.test.assertEq('30001', id);
+ chrome.test.assertEq(60, level);
+ });
}
-});
-chrome.test.sendMessage("loaded");
+]);
+
+chrome.test.sendMessage('loaded');
« no previous file with comments | « extensions/test/data/api_test/audio/test.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698