From f8f5914e45c17620afa11f257d03389b3af4d20f Mon Sep 17 00:00:00 2001 From: "hubbe@chromium.org" Date: Mon, 31 Mar 2014 20:32:26 +0000 Subject: Cast: Make the performance tests use UDPProxy to simulate networks Unfortunately this makes the test not pass, but since the tests are still not running on the automated bots, that is hopefully acceptable until we can fix the problem(s). Review URL: https://codereview.chromium.org/217703003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260634 0039d316-1c4b-4281-b951-d872f2087c98 --- .../api/cast_streaming/performance_test.cc | 32 +++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/chrome/browser/extensions/api/cast_streaming/performance_test.cc b/chrome/browser/extensions/api/cast_streaming/performance_test.cc index 08f042a..c252d13 100644 --- a/chrome/browser/extensions/api/cast_streaming/performance_test.cc +++ b/chrome/browser/extensions/api/cast_streaming/performance_test.cc @@ -40,6 +40,7 @@ #include "media/cast/test/utility/default_config.h" #include "media/cast/test/utility/in_process_receiver.h" #include "media/cast/test/utility/standalone_cast_environment.h" +#include "media/cast/test/utility/udp_proxy.h" #include "net/base/ip_endpoint.h" #include "net/base/net_errors.h" #include "net/base/net_util.h" @@ -67,6 +68,8 @@ enum TestFlags { k24fps = 1 << 3, // use 24 fps video k30fps = 1 << 4, // use 30 fps video k60fps = 1 << 5, // use 60 fps video + kProxyWifi = 1 << 6, // Run UDP through UDPProxy wifi profile + kProxyEvil = 1 << 7, // Run UDP through UDPProxy evil profile }; // We log one of these for each call to OnAudioFrame/OnVideoFrame. @@ -284,6 +287,10 @@ class CastV2PerformanceTest suffix += "_30fps"; if (HasFlag(k60fps)) suffix += "_60fps"; + if (HasFlag(kProxyWifi)) + suffix += "_wifi"; + if (HasFlag(kProxyEvil)) + suffix += "_evil"; return suffix; } @@ -552,6 +559,27 @@ class CastV2PerformanceTest new TestPatternReceiver(cast_environment, receiver_end_point); receiver->Start(); + scoped_ptr udp_proxy; + if (HasFlag(kProxyWifi) || HasFlag(kProxyEvil)) { + net::IPEndPoint proxy_end_point = GetFreeLocalPort(); + if (HasFlag(kProxyWifi)) { + udp_proxy = media::cast::test::UDPProxy::Create( + proxy_end_point, + receiver_end_point, + media::cast::test::WifiNetwork().Pass(), + media::cast::test::WifiNetwork().Pass(), + NULL); + } else if (HasFlag(kProxyEvil)) { + udp_proxy = media::cast::test::UDPProxy::Create( + proxy_end_point, + receiver_end_point, + media::cast::test::EvilNetwork().Pass(), + media::cast::test::EvilNetwork().Pass(), + NULL); + } + receiver_end_point = proxy_end_point; + } + std::string json_events; ASSERT_TRUE(tracing::BeginTracing("test_fps,mirroring,cast_perf_test")); const std::string page_url = base::StringPrintf( @@ -617,4 +645,6 @@ INSTANTIATE_TEST_CASE_P( kUseGpu | k24fps, kUseGpu | k30fps, kUseGpu | k60fps, - kDisableVsync | k24fps | kUseGpu)); + kUseGpu | k24fps | kDisableVsync, + kUseGpu | k30fps | kProxyWifi, + kUseGpu | k30fps | kProxyEvil)); -- cgit v1.1