OLD | NEW |
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 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 : public ExtensionApiTest, | 285 : public ExtensionApiTest, |
286 public testing::WithParamInterface<int> { | 286 public testing::WithParamInterface<int> { |
287 public: | 287 public: |
288 CastV2PerformanceTest() {} | 288 CastV2PerformanceTest() {} |
289 | 289 |
290 bool HasFlag(TestFlags flag) const { | 290 bool HasFlag(TestFlags flag) const { |
291 return (GetParam() & flag) == flag; | 291 return (GetParam() & flag) == flag; |
292 } | 292 } |
293 | 293 |
294 bool IsGpuAvailable() const { | 294 bool IsGpuAvailable() const { |
295 return CommandLine::ForCurrentProcess()->HasSwitch("enable-gpu"); | 295 return base::CommandLine::ForCurrentProcess()->HasSwitch("enable-gpu"); |
296 } | 296 } |
297 | 297 |
298 std::string GetSuffixForTestFlags() { | 298 std::string GetSuffixForTestFlags() { |
299 std::string suffix; | 299 std::string suffix; |
300 if (HasFlag(kUseGpu)) | 300 if (HasFlag(kUseGpu)) |
301 suffix += "_gpu"; | 301 suffix += "_gpu"; |
302 if (HasFlag(kDisableVsync)) | 302 if (HasFlag(kDisableVsync)) |
303 suffix += "_novsync"; | 303 suffix += "_novsync"; |
304 if (HasFlag(kSmallWindow)) | 304 if (HasFlag(kSmallWindow)) |
305 suffix += "_small"; | 305 suffix += "_small"; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 net::IPEndPoint endpoint; | 347 net::IPEndPoint endpoint; |
348 CHECK_EQ(net::OK, receive_socket->GetLocalAddress(&endpoint)); | 348 CHECK_EQ(net::OK, receive_socket->GetLocalAddress(&endpoint)); |
349 return endpoint; | 349 return endpoint; |
350 } | 350 } |
351 | 351 |
352 void SetUp() override { | 352 void SetUp() override { |
353 EnablePixelOutput(); | 353 EnablePixelOutput(); |
354 ExtensionApiTest::SetUp(); | 354 ExtensionApiTest::SetUp(); |
355 } | 355 } |
356 | 356 |
357 void SetUpCommandLine(CommandLine* command_line) override { | 357 void SetUpCommandLine(base::CommandLine* command_line) override { |
358 // Some of the tests may launch http requests through JSON or AJAX | 358 // Some of the tests may launch http requests through JSON or AJAX |
359 // which causes a security error (cross domain request) when the page | 359 // which causes a security error (cross domain request) when the page |
360 // is loaded from the local file system ( file:// ). The following switch | 360 // is loaded from the local file system ( file:// ). The following switch |
361 // fixes that error. | 361 // fixes that error. |
362 command_line->AppendSwitch(switches::kAllowFileAccessFromFiles); | 362 command_line->AppendSwitch(switches::kAllowFileAccessFromFiles); |
363 | 363 |
364 if (HasFlag(kSmallWindow)) { | 364 if (HasFlag(kSmallWindow)) { |
365 command_line->AppendSwitchASCII(switches::kWindowSize, "800,600"); | 365 command_line->AppendSwitchASCII(switches::kWindowSize, "800,600"); |
366 } else { | 366 } else { |
367 command_line->AppendSwitchASCII(switches::kWindowSize, "2000,1500"); | 367 command_line->AppendSwitchASCII(switches::kWindowSize, "2000,1500"); |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 CastV2PerformanceTest, | 666 CastV2PerformanceTest, |
667 testing::Values( | 667 testing::Values( |
668 kUseGpu | k24fps, | 668 kUseGpu | k24fps, |
669 kUseGpu | k30fps, | 669 kUseGpu | k30fps, |
670 kUseGpu | k60fps, | 670 kUseGpu | k60fps, |
671 kUseGpu | k24fps | kDisableVsync, | 671 kUseGpu | k24fps | kDisableVsync, |
672 kUseGpu | k30fps | kProxyWifi, | 672 kUseGpu | k30fps | kProxyWifi, |
673 kUseGpu | k30fps | kProxyBad, | 673 kUseGpu | k30fps | kProxyBad, |
674 kUseGpu | k30fps | kSlowClock, | 674 kUseGpu | k30fps | kSlowClock, |
675 kUseGpu | k30fps | kFastClock)); | 675 kUseGpu | k30fps | kFastClock)); |
OLD | NEW |