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

Unified Diff: content/test/data/media/webrtc_test_utilities.js

Issue 2922733002: Propagate muted state from MediaStreamAudioSource into JS. (Closed)
Patch Set: Made SetMuted call unconditional. Rebased. Created 3 years, 6 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: content/test/data/media/webrtc_test_utilities.js
diff --git a/content/test/data/media/webrtc_test_utilities.js b/content/test/data/media/webrtc_test_utilities.js
index aa11a975912478108af4879dd16c6d35000788fe..2d0c4758e6507dd088d1d4f139dd7755b61e5b69 100644
--- a/content/test/data/media/webrtc_test_utilities.js
+++ b/content/test/data/media/webrtc_test_utilities.js
@@ -18,6 +18,8 @@ var gNumberOfEvents = 0;
var gAllEventsOccured = function () {};
+var gPendingTimeout;
+
// Use this function to set a function that will be called once all expected
// events has occurred.
function setAllEventsOccuredHandler(handler) {
@@ -41,6 +43,20 @@ function failTest(reason) {
window.domAutomationController.send(error.stack);
}
+// Fail a test on the C++ side after a timeout. Will cancel any pending timeout.
+function failTestAfterTimeout(reason, timeout_ms) {
+ cancelTestTimeout();
+ gPendingTimeout = setTimeout(function() {
+ failTest(reason);
+ }, timeout_ms);
+}
+
+// Cancels the current test timeout.
+function cancelTestTimeout() {
+ clearTimeout(gPendingTimeout);
+ gPendingTimeout = null;
+}
+
// Called if getUserMedia fails.
function printGetUserMediaError(error) {
var message = 'getUserMedia request unexpectedly failed:';
@@ -262,4 +278,3 @@ function assertTrue(booleanExpression, description) {
failTest(description);
}
}
-
« no previous file with comments | « content/test/data/media/getusermedia.html ('k') | third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamTrack.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698