Commit f8c05106 authored by hubbe's avatar hubbe Committed by Commit bot

Fix some shutdown problems in tab capture performance tests.

As usual, the RunUntilIdle() call causes problems. Calling stop() on the
webrtc stream apparently doesn't propagate back to the capture, so make sure
that we call stop() on the capture stream explicitly.

Also, raise frame rate to 60 fps.

Not entirely sure if this will fix the attached bug or not, but either way it's a problem that should be fixed.

BUG=474808

Review URL: https://codereview.chromium.org/1076533002

Cr-Commit-Position: refs/heads/master@{#324325}
parent b2013c3f
...@@ -187,7 +187,7 @@ class TabCapturePerformanceTest ...@@ -187,7 +187,7 @@ class TabCapturePerformanceTest
// Ideally we'd like to run a higher capture rate when vsync is disabled, // Ideally we'd like to run a higher capture rate when vsync is disabled,
// but libjingle currently doesn't allow that. // but libjingle currently doesn't allow that.
// page += HasFlag(kDisableVsync) ? "&fps=300" : "&fps=30"; // page += HasFlag(kDisableVsync) ? "&fps=300" : "&fps=30";
page += "&fps=30"; page += "&fps=60";
ASSERT_TRUE(RunExtensionSubtest("tab_capture", page)) << message_; ASSERT_TRUE(RunExtensionSubtest("tab_capture", page)) << message_;
ASSERT_TRUE(tracing::EndTracing(&json_events)); ASSERT_TRUE(tracing::EndTracing(&json_events));
scoped_ptr<trace_analyzer::TraceAnalyzer> analyzer; scoped_ptr<trace_analyzer::TraceAnalyzer> analyzer;
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
// Global to prevent gc from eating the video tag. // Global to prevent gc from eating the video tag.
var video = null; var video = null;
var capture_stream = null;
function TestStream(stream) { function TestStream(stream) {
// Create video and canvas elements, but no need to append them to the // Create video and canvas elements, but no need to append them to the
...@@ -38,6 +39,9 @@ function TestStream(stream) { ...@@ -38,6 +39,9 @@ function TestStream(stream) {
// Note that the API testing framework might not terminate if we keep // Note that the API testing framework might not terminate if we keep
// animating and capturing, so we have to make sure that we stop doing // animating and capturing, so we have to make sure that we stop doing
// that here. // that here.
if (capture_stream) {
capture_stream.stop();
}
stream.stop(); stream.stop();
return; return;
} }
...@@ -64,6 +68,7 @@ function TestStream(stream) { ...@@ -64,6 +68,7 @@ function TestStream(stream) {
// Set up a WebRTC connection and pipe |stream| through it. // Set up a WebRTC connection and pipe |stream| through it.
function testThroughWebRTC(stream) { function testThroughWebRTC(stream) {
capture_stream = stream;
console.log("Testing through webrtc."); console.log("Testing through webrtc.");
var sender = new webkitRTCPeerConnection(null); var sender = new webkitRTCPeerConnection(null);
var receiver = new webkitRTCPeerConnection(null); var receiver = new webkitRTCPeerConnection(null);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment