summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmarshall@chromium.org <kmarshall@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-23 22:53:02 +0000
committerkmarshall@chromium.org <kmarshall@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-23 22:53:02 +0000
commitc1cc3ab4c9c35861929c54677e0fc732c1645ced (patch)
treeb3df6b293499ddb44159c288ad1c420574b65b54
parent4880b4c69e9780618164dfe37b5af6740bd3d28b (diff)
downloadchromium_src-c1cc3ab4c9c35861929c54677e0fc732c1645ced.zip
chromium_src-c1cc3ab4c9c35861929c54677e0fc732c1645ced.tar.gz
chromium_src-c1cc3ab4c9c35861929c54677e0fc732c1645ced.tar.bz2
Fix test CastStreamingApiTestWithPixelOutput.EndToEnd.
Update end_to_end_sender.js to use standard WebAudio API. Modify unit test to use a larger window size (previous window size was too small, which negatively impacted the median color computation routine.) BUG=349599 R=miu@chromium.org Review URL: https://codereview.chromium.org/339433003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@279210 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/extensions/api/cast_streaming/cast_streaming_apitest.cc20
-rw-r--r--chrome/test/data/extensions/api_test/cast_streaming/end_to_end_sender.js15
2 files changed, 14 insertions, 21 deletions
diff --git a/chrome/browser/extensions/api/cast_streaming/cast_streaming_apitest.cc b/chrome/browser/extensions/api/cast_streaming/cast_streaming_apitest.cc
index a10f300..c66a0a1 100644
--- a/chrome/browser/extensions/api/cast_streaming/cast_streaming_apitest.cc
+++ b/chrome/browser/extensions/api/cast_streaming/cast_streaming_apitest.cc
@@ -22,6 +22,7 @@
#include "media/cast/test/utility/audio_utility.h"
#include "media/cast/test/utility/default_config.h"
#include "media/cast/test/utility/in_process_receiver.h"
+#include "media/cast/test/utility/net_utility.h"
#include "media/cast/test/utility/standalone_cast_environment.h"
#include "net/base/net_errors.h"
#include "net/base/net_util.h"
@@ -29,6 +30,8 @@
#include "net/udp/udp_socket.h"
#include "testing/gtest/include/gtest/gtest.h"
+using media::cast::test::GetFreeLocalPort;
+
namespace extensions {
class CastStreamingApiTest : public ExtensionApiTest {
@@ -38,6 +41,7 @@ class CastStreamingApiTest : public ExtensionApiTest {
command_line->AppendSwitchASCII(
extensions::switches::kWhitelistedExtensionID,
"ddchlicdkolnonkihahngkmmmjnjlkkf");
+ command_line->AppendSwitchASCII(::switches::kWindowSize, "400,400");
}
};
@@ -291,26 +295,14 @@ class CastStreamingApiTestWithPixelOutput : public CastStreamingApiTest {
// use the API to send it out. At the same time, this test launches an
// in-process Cast receiver, listening on a localhost UDP socket, to receive the
// content and check whether it matches expectations.
-//
-// Note: This test is disabled until outstanding bugs are fixed and the
-// media/cast library has achieved sufficient stability.
-// http://crbug.com/349599
-IN_PROC_BROWSER_TEST_F(CastStreamingApiTestWithPixelOutput, DISABLED_EndToEnd) {
- // Determine a unused UDP port for the in-process receiver to listen on.
- // Method: Bind a UDP socket on port 0, and then check which port the
- // operating system assigned to it.
- net::IPAddressNumber localhost;
- localhost.push_back(127);
- localhost.push_back(0);
- localhost.push_back(0);
- localhost.push_back(1);
+IN_PROC_BROWSER_TEST_F(CastStreamingApiTestWithPixelOutput, EndToEnd) {
scoped_ptr<net::UDPSocket> receive_socket(
new net::UDPSocket(net::DatagramSocket::DEFAULT_BIND,
net::RandIntCallback(),
NULL,
net::NetLog::Source()));
receive_socket->AllowAddressReuse();
- ASSERT_EQ(net::OK, receive_socket->Bind(net::IPEndPoint(localhost, 0)));
+ ASSERT_EQ(net::OK, receive_socket->Bind(GetFreeLocalPort()));
net::IPEndPoint receiver_end_point;
ASSERT_EQ(net::OK, receive_socket->GetLocalAddress(&receiver_end_point));
receive_socket.reset();
diff --git a/chrome/test/data/extensions/api_test/cast_streaming/end_to_end_sender.js b/chrome/test/data/extensions/api_test/cast_streaming/end_to_end_sender.js
index aac11da..f67b3ea 100644
--- a/chrome/test/data/extensions/api_test/cast_streaming/end_to_end_sender.js
+++ b/chrome/test/data/extensions/api_test/cast_streaming/end_to_end_sender.js
@@ -37,21 +37,22 @@ function updateTestPattern() {
}
if (!this.audioContext) {
- this.audioContext = new webkitAudioContext();
- this.gainNode = this.audioContext.createGainNode();
+ this.audioContext = new AudioContext();
+ this.gainNode = this.audioContext.createGain();
this.gainNode.gain.value = 0.5;
this.gainNode.connect(this.audioContext.destination);
} else {
+ this.oscillator.stop();
this.oscillator.disconnect();
}
// Note: We recreate the oscillator each time because this switches the audio
// frequency immediately. Re-using the same oscillator tends to take several
// hundred milliseconds to ramp-up/down the frequency.
this.oscillator = audioContext.createOscillator();
- this.oscillator.type = "sine";
+ this.oscillator.type = OscillatorNode.SINE;
this.oscillator.frequency.value = freqs[curTestIdx];
- this.oscillator.connect(gainNode);
- this.oscillator.noteOn(0);
+ this.oscillator.connect(this.gainNode);
+ this.oscillator.start();
}
// Calls updateTestPattern(), then waits and calls itself again to advance to
@@ -95,8 +96,8 @@ chrome.test.runTests([
return;
}
- var width = 128;
- var height = 128;
+ var width = 400;
+ var height = 400;
var frameRate = 15;
chrome.tabCapture.capture(