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

Side by Side Diff: chrome/browser/extensions/api/cast_streaming/performance_test.cc

Issue 721273002: Remove timing limitation to set Broadcast, ReceiveBuffer, and SendBuffer options from UDPSocket. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include <map> 5 #include <map>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #if defined(OS_MACOSX) 10 #if defined(OS_MACOSX)
(...skipping 30 matching lines...) Expand all
41 #include "media/cast/test/utility/audio_utility.h" 41 #include "media/cast/test/utility/audio_utility.h"
42 #include "media/cast/test/utility/barcode.h" 42 #include "media/cast/test/utility/barcode.h"
43 #include "media/cast/test/utility/default_config.h" 43 #include "media/cast/test/utility/default_config.h"
44 #include "media/cast/test/utility/in_process_receiver.h" 44 #include "media/cast/test/utility/in_process_receiver.h"
45 #include "media/cast/test/utility/standalone_cast_environment.h" 45 #include "media/cast/test/utility/standalone_cast_environment.h"
46 #include "media/cast/test/utility/udp_proxy.h" 46 #include "media/cast/test/utility/udp_proxy.h"
47 #include "net/base/ip_endpoint.h" 47 #include "net/base/ip_endpoint.h"
48 #include "net/base/net_errors.h" 48 #include "net/base/net_errors.h"
49 #include "net/base/net_util.h" 49 #include "net/base/net_util.h"
50 #include "net/base/rand_callback.h" 50 #include "net/base/rand_callback.h"
51 #include "net/udp/udp_socket.h" 51 #include "net/udp/udp_server_socket.h"
52 #include "testing/gtest/include/gtest/gtest.h" 52 #include "testing/gtest/include/gtest/gtest.h"
53 #include "testing/perf/perf_test.h" 53 #include "testing/perf/perf_test.h"
54 #include "ui/compositor/compositor_switches.h" 54 #include "ui/compositor/compositor_switches.h"
55 #include "ui/gl/gl_switches.h" 55 #include "ui/gl/gl_switches.h"
56 56
57 namespace { 57 namespace {
58 58
59 const char kExtensionId[] = "ddchlicdkolnonkihahngkmmmjnjlkkf"; 59 const char kExtensionId[] = "ddchlicdkolnonkihahngkmmmjnjlkkf";
60 60
61 // Skip a few events from the beginning. 61 // Skip a few events from the beginning.
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 336
337 net::IPEndPoint GetFreeLocalPort() { 337 net::IPEndPoint GetFreeLocalPort() {
338 // Determine a unused UDP port for the in-process receiver to listen on. 338 // Determine a unused UDP port for the in-process receiver to listen on.
339 // Method: Bind a UDP socket on port 0, and then check which port the 339 // Method: Bind a UDP socket on port 0, and then check which port the
340 // operating system assigned to it. 340 // operating system assigned to it.
341 net::IPAddressNumber localhost; 341 net::IPAddressNumber localhost;
342 localhost.push_back(127); 342 localhost.push_back(127);
343 localhost.push_back(0); 343 localhost.push_back(0);
344 localhost.push_back(0); 344 localhost.push_back(0);
345 localhost.push_back(1); 345 localhost.push_back(1);
346 scoped_ptr<net::UDPSocket> receive_socket( 346 scoped_ptr<net::UDPServerSocket> receive_socket(
347 new net::UDPSocket(net::DatagramSocket::DEFAULT_BIND, 347 new net::UDPServerSocket(NULL, net::NetLog::Source()));
348 net::RandIntCallback(),
349 NULL,
350 net::NetLog::Source()));
351 receive_socket->AllowAddressReuse(); 348 receive_socket->AllowAddressReuse();
352 CHECK_EQ(net::OK, receive_socket->Bind(net::IPEndPoint(localhost, 0))); 349 CHECK_EQ(net::OK, receive_socket->Listen(net::IPEndPoint(localhost, 0)));
353 net::IPEndPoint endpoint; 350 net::IPEndPoint endpoint;
354 CHECK_EQ(net::OK, receive_socket->GetLocalAddress(&endpoint)); 351 CHECK_EQ(net::OK, receive_socket->GetLocalAddress(&endpoint));
355 return endpoint; 352 return endpoint;
356 } 353 }
357 354
358 void SetUp() override { 355 void SetUp() override {
359 EnablePixelOutput(); 356 EnablePixelOutput();
360 ExtensionApiTest::SetUp(); 357 ExtensionApiTest::SetUp();
361 } 358 }
362 359
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 CastV2PerformanceTest, 669 CastV2PerformanceTest,
673 testing::Values( 670 testing::Values(
674 kUseGpu | k24fps, 671 kUseGpu | k24fps,
675 kUseGpu | k30fps, 672 kUseGpu | k30fps,
676 kUseGpu | k60fps, 673 kUseGpu | k60fps,
677 kUseGpu | k24fps | kDisableVsync, 674 kUseGpu | k24fps | kDisableVsync,
678 kUseGpu | k30fps | kProxyWifi, 675 kUseGpu | k30fps | kProxyWifi,
679 kUseGpu | k30fps | kProxyBad, 676 kUseGpu | k30fps | kProxyBad,
680 kUseGpu | k30fps | kSlowClock, 677 kUseGpu | k30fps | kSlowClock,
681 kUseGpu | k30fps | kFastClock)); 678 kUseGpu | k30fps | kFastClock));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698