OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/environment.h" | 5 #include "base/environment.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/process/launch.h" | 8 #include "base/process/launch.h" |
9 #include "base/strings/string_split.h" | 9 #include "base/strings/string_split.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // * zxing (see the CPP version at https://code.google.com/p/zxing) | 86 // * zxing (see the CPP version at https://code.google.com/p/zxing) |
87 // * ffmpeg 0.11.1 or compatible version (see http://www.ffmpeg.org) | 87 // * ffmpeg 0.11.1 or compatible version (see http://www.ffmpeg.org) |
88 // | 88 // |
89 // The test case will launch a custom binary (peerconnection_server) which will | 89 // The test case will launch a custom binary (peerconnection_server) which will |
90 // allow two WebRTC clients to find each other. | 90 // allow two WebRTC clients to find each other. |
91 // | 91 // |
92 // The test also runs several other custom binaries - rgba_to_i420 converter and | 92 // The test also runs several other custom binaries - rgba_to_i420 converter and |
93 // frame_analyzer. Both tools can be found under third_party/webrtc/tools. The | 93 // frame_analyzer. Both tools can be found under third_party/webrtc/tools. The |
94 // test also runs a stand alone Python implementation of a WebSocket server | 94 // test also runs a stand alone Python implementation of a WebSocket server |
95 // (pywebsocket) and a barcode_decoder script. | 95 // (pywebsocket) and a barcode_decoder script. |
96 class WebrtcVideoQualityBrowserTest : public WebRtcTestBase { | 96 class WebRtcVideoQualityBrowserTest : public WebRtcTestBase { |
97 public: | 97 public: |
98 WebrtcVideoQualityBrowserTest() | 98 WebRtcVideoQualityBrowserTest() |
99 : pywebsocket_server_(0), | 99 : pywebsocket_server_(0), |
100 environment_(base::Environment::Create()) {} | 100 environment_(base::Environment::Create()) {} |
101 | 101 |
102 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 102 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
103 PeerConnectionServerRunner::KillAllPeerConnectionServersOnCurrentSystem(); | 103 PeerConnectionServerRunner::KillAllPeerConnectionServersOnCurrentSystem(); |
104 DetectErrorsInJavaScript(); // Look for errors in our rather complex js. | 104 DetectErrorsInJavaScript(); // Look for errors in our rather complex js. |
105 } | 105 } |
106 | 106 |
107 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 107 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
108 // This test expects real device handling and requires a real webcam / audio | 108 // This test expects real device handling and requires a real webcam / audio |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 base::FilePath GetBrowserDir() { | 309 base::FilePath GetBrowserDir() { |
310 base::FilePath browser_dir; | 310 base::FilePath browser_dir; |
311 EXPECT_TRUE(PathService::Get(base::DIR_MODULE, &browser_dir)); | 311 EXPECT_TRUE(PathService::Get(base::DIR_MODULE, &browser_dir)); |
312 return browser_dir; | 312 return browser_dir; |
313 } | 313 } |
314 | 314 |
315 base::ProcessHandle pywebsocket_server_; | 315 base::ProcessHandle pywebsocket_server_; |
316 scoped_ptr<base::Environment> environment_; | 316 scoped_ptr<base::Environment> environment_; |
317 }; | 317 }; |
318 | 318 |
319 IN_PROC_BROWSER_TEST_F(WebrtcVideoQualityBrowserTest, | 319 IN_PROC_BROWSER_TEST_F(WebRtcVideoQualityBrowserTest, |
320 MANUAL_TestVGAVideoQuality) { | 320 MANUAL_TestVGAVideoQuality) { |
321 ASSERT_GE(TestTimeouts::action_max_timeout().InSeconds(), 150) << | 321 ASSERT_GE(TestTimeouts::action_max_timeout().InSeconds(), 150) << |
322 "This is a long-running test; you must specify " | 322 "This is a long-running test; you must specify " |
323 "--ui-test-action-max-timeout to have a value of at least 150000."; | 323 "--ui-test-action-max-timeout to have a value of at least 150000."; |
324 | 324 |
325 ASSERT_TRUE(HasAllRequiredResources()); | 325 ASSERT_TRUE(HasAllRequiredResources()); |
326 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 326 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
327 ASSERT_TRUE(StartPyWebSocketServer()); | 327 ASSERT_TRUE(StartPyWebSocketServer()); |
328 ASSERT_TRUE(peerconnection_server_.Start()); | 328 ASSERT_TRUE(peerconnection_server_.Start()); |
329 | 329 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 | 366 |
367 RunARGBtoI420Converter( | 367 RunARGBtoI420Converter( |
368 kVgaWidth, kVgaHeight, GetWorkingDir().Append(kCapturedYuvFileName)); | 368 kVgaWidth, kVgaHeight, GetWorkingDir().Append(kCapturedYuvFileName)); |
369 ASSERT_TRUE( | 369 ASSERT_TRUE( |
370 CompareVideosAndPrintResult(kVgaWidth, | 370 CompareVideosAndPrintResult(kVgaWidth, |
371 kVgaHeight, | 371 kVgaHeight, |
372 GetWorkingDir().Append(kCapturedYuvFileName), | 372 GetWorkingDir().Append(kCapturedYuvFileName), |
373 GetWorkingDir().Append(kReferenceYuvFileName), | 373 GetWorkingDir().Append(kReferenceYuvFileName), |
374 GetWorkingDir().Append(kStatsFileName))); | 374 GetWorkingDir().Append(kStatsFileName))); |
375 } | 375 } |
OLD | NEW |