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

Side by Side Diff: content/test/data/media/webrtc_test_utilities.js

Issue 15688006: Made sure empty-call-then-add-one-stream test doesn't do simultaneous negotiations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/test/data/media/peerconnection-call.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // These must match with how the video and canvas tags are declared in html. 5 // These must match with how the video and canvas tags are declared in html.
6 const VIDEO_TAG_WIDTH = 320; 6 const VIDEO_TAG_WIDTH = 320;
7 const VIDEO_TAG_HEIGHT = 240; 7 const VIDEO_TAG_HEIGHT = 240;
8 8
9 // Number of test events to occur before the test pass. When the test pass, 9 // Number of test events to occur before the test pass. When the test pass,
10 // the function gAllEventsOccured is called. 10 // the function gAllEventsOccured is called.
(...skipping 26 matching lines...) Expand all
37 } 37 }
38 }, 100); 38 }, 100);
39 } 39 }
40 40
41 function waitForVideo(videoElement) { 41 function waitForVideo(videoElement) {
42 document.title = 'Waiting for video...'; 42 document.title = 'Waiting for video...';
43 addExpectedEvent(); 43 addExpectedEvent();
44 detectVideoIn(videoElement, function () { eventOccured(); }); 44 detectVideoIn(videoElement, function () { eventOccured(); });
45 } 45 }
46 46
47 function waitForConnectionToStabilize(peerConnection) {
48 addExpectedEvent();
49 var waitForStabilization = setInterval(function() {
50 if (peerConnection.signalingState == 'stable') {
51 clearInterval(waitForStabilization);
52 eventOccured();
53 }
54 }, 100);
55 }
56
47 function addExpectedEvent() { 57 function addExpectedEvent() {
48 ++gNumberOfExpectedEvents; 58 ++gNumberOfExpectedEvents;
49 } 59 }
50 60
51 function eventOccured() { 61 function eventOccured() {
52 ++gNumberOfEvents; 62 ++gNumberOfEvents;
53 if (gNumberOfEvents == gNumberOfExpectedEvents) { 63 if (gNumberOfEvents == gNumberOfExpectedEvents) {
54 gAllEventsOccured(); 64 gAllEventsOccured();
55 } 65 }
56 } 66 }
(...skipping 14 matching lines...) Expand all
71 81
72 // This function matches |left| and |right| and throws an exception if the 82 // This function matches |left| and |right| and throws an exception if the
73 // values don't match. 83 // values don't match.
74 function expectEquals(left, right) { 84 function expectEquals(left, right) {
75 if (left != right) { 85 if (left != right) {
76 var s = "expectEquals failed left: " + left + " right: " + right; 86 var s = "expectEquals failed left: " + left + " right: " + right;
77 document.title = s; 87 document.title = s;
78 throw s; 88 throw s;
79 } 89 }
80 } 90 }
OLDNEW
« no previous file with comments | « content/test/data/media/peerconnection-call.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698