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 12 matching lines...) Expand all Loading... |
23 #include "chrome/common/chrome_switches.h" | 23 #include "chrome/common/chrome_switches.h" |
24 #include "chrome/test/base/in_process_browser_test.h" | 24 #include "chrome/test/base/in_process_browser_test.h" |
25 #include "chrome/test/base/ui_test_utils.h" | 25 #include "chrome/test/base/ui_test_utils.h" |
26 #include "chrome/test/ui/ui_test.h" | 26 #include "chrome/test/ui/ui_test.h" |
27 #include "content/public/browser/notification_service.h" | 27 #include "content/public/browser/notification_service.h" |
28 #include "content/public/test/browser_test_utils.h" | 28 #include "content/public/test/browser_test_utils.h" |
29 #include "net/test/embedded_test_server/embedded_test_server.h" | 29 #include "net/test/embedded_test_server/embedded_test_server.h" |
30 #include "net/test/python_utils.h" | 30 #include "net/test/python_utils.h" |
31 #include "testing/perf/perf_test.h" | 31 #include "testing/perf/perf_test.h" |
32 | 32 |
| 33 // Temporarily disabled on Linux. |
| 34 // http://crbug.com/281268. |
| 35 #if defined(OS_LINUX) |
| 36 #define MAYBE_WebrtcVideoQualityBrowserTest DISABLED_WebrtcVideoQualityBrowserTe
st |
| 37 #else |
| 38 #define MAYBE_WebrtcVideoQualityBrowserTest WebrtcVideoQualityBrowserTest |
| 39 #endif |
| 40 |
33 static const base::FilePath::CharType kFrameAnalyzerExecutable[] = | 41 static const base::FilePath::CharType kFrameAnalyzerExecutable[] = |
34 #if defined(OS_WIN) | 42 #if defined(OS_WIN) |
35 FILE_PATH_LITERAL("frame_analyzer.exe"); | 43 FILE_PATH_LITERAL("frame_analyzer.exe"); |
36 #else | 44 #else |
37 FILE_PATH_LITERAL("frame_analyzer"); | 45 FILE_PATH_LITERAL("frame_analyzer"); |
38 #endif | 46 #endif |
39 | 47 |
40 static const base::FilePath::CharType kArgbToI420ConverterExecutable[] = | 48 static const base::FilePath::CharType kArgbToI420ConverterExecutable[] = |
41 #if defined(OS_WIN) | 49 #if defined(OS_WIN) |
42 FILE_PATH_LITERAL("rgba_to_i420_converter.exe"); | 50 FILE_PATH_LITERAL("rgba_to_i420_converter.exe"); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 // * zxing (see the CPP version at https://code.google.com/p/zxing) | 93 // * zxing (see the CPP version at https://code.google.com/p/zxing) |
86 // * ffmpeg 0.11.1 or compatible version (see http://www.ffmpeg.org) | 94 // * ffmpeg 0.11.1 or compatible version (see http://www.ffmpeg.org) |
87 // | 95 // |
88 // The test case will launch a custom binary (peerconnection_server) which will | 96 // The test case will launch a custom binary (peerconnection_server) which will |
89 // allow two WebRTC clients to find each other. | 97 // allow two WebRTC clients to find each other. |
90 // | 98 // |
91 // The test also runs several other custom binaries - rgba_to_i420 converter and | 99 // The test also runs several other custom binaries - rgba_to_i420 converter and |
92 // frame_analyzer. Both tools can be found under third_party/webrtc/tools. The | 100 // frame_analyzer. Both tools can be found under third_party/webrtc/tools. The |
93 // test also runs a stand alone Python implementation of a WebSocket server | 101 // test also runs a stand alone Python implementation of a WebSocket server |
94 // (pywebsocket) and a barcode_decoder script. | 102 // (pywebsocket) and a barcode_decoder script. |
95 class WebrtcVideoQualityBrowserTest : public WebRtcTestBase { | 103 class MAYBE_WebrtcVideoQualityBrowserTest : public WebRtcTestBase { |
96 public: | 104 public: |
97 WebrtcVideoQualityBrowserTest() | 105 MAYBE_WebrtcVideoQualityBrowserTest() |
98 : pywebsocket_server_(0), | 106 : pywebsocket_server_(0), |
99 environment_(base::Environment::Create()) {} | 107 environment_(base::Environment::Create()) {} |
100 | 108 |
101 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 109 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
102 PeerConnectionServerRunner::KillAllPeerConnectionServersOnCurrentSystem(); | 110 PeerConnectionServerRunner::KillAllPeerConnectionServersOnCurrentSystem(); |
103 } | 111 } |
104 | 112 |
105 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 113 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
106 // This test expects real device handling and requires a real webcam / audio | 114 // This test expects real device handling and requires a real webcam / audio |
107 // device; it will not work with fake devices. | 115 // device; it will not work with fake devices. |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 base::FilePath GetBrowserDir() { | 324 base::FilePath GetBrowserDir() { |
317 base::FilePath browser_dir; | 325 base::FilePath browser_dir; |
318 EXPECT_TRUE(PathService::Get(base::DIR_MODULE, &browser_dir)); | 326 EXPECT_TRUE(PathService::Get(base::DIR_MODULE, &browser_dir)); |
319 return browser_dir; | 327 return browser_dir; |
320 } | 328 } |
321 | 329 |
322 base::ProcessHandle pywebsocket_server_; | 330 base::ProcessHandle pywebsocket_server_; |
323 scoped_ptr<base::Environment> environment_; | 331 scoped_ptr<base::Environment> environment_; |
324 }; | 332 }; |
325 | 333 |
326 IN_PROC_BROWSER_TEST_F(WebrtcVideoQualityBrowserTest, | 334 IN_PROC_BROWSER_TEST_F(MAYBE_WebrtcVideoQualityBrowserTest, |
327 MANUAL_TestVGAVideoQuality) { | 335 MANUAL_TestVGAVideoQuality) { |
328 ASSERT_TRUE(HasAllRequiredResources()); | 336 ASSERT_TRUE(HasAllRequiredResources()); |
329 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 337 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
330 ASSERT_TRUE(StartPyWebSocketServer()); | 338 ASSERT_TRUE(StartPyWebSocketServer()); |
331 ASSERT_TRUE(peerconnection_server_.Start()); | 339 ASSERT_TRUE(peerconnection_server_.Start()); |
332 | 340 |
333 ui_test_utils::NavigateToURL( | 341 ui_test_utils::NavigateToURL( |
334 browser(), embedded_test_server()->GetURL(kMainWebrtcTestHtmlPage)); | 342 browser(), embedded_test_server()->GetURL(kMainWebrtcTestHtmlPage)); |
335 content::WebContents* left_tab = | 343 content::WebContents* left_tab = |
336 browser()->tab_strip_model()->GetActiveWebContents(); | 344 browser()->tab_strip_model()->GetActiveWebContents(); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 | 389 |
382 RunARGBtoI420Converter( | 390 RunARGBtoI420Converter( |
383 kVgaWidth, kVgaHeight, GetWorkingDir().Append(kCapturedYuvFileName)); | 391 kVgaWidth, kVgaHeight, GetWorkingDir().Append(kCapturedYuvFileName)); |
384 ASSERT_TRUE( | 392 ASSERT_TRUE( |
385 CompareVideosAndPrintResult(kVgaWidth, | 393 CompareVideosAndPrintResult(kVgaWidth, |
386 kVgaHeight, | 394 kVgaHeight, |
387 GetWorkingDir().Append(kCapturedYuvFileName), | 395 GetWorkingDir().Append(kCapturedYuvFileName), |
388 GetWorkingDir().Append(kReferenceYuvFileName), | 396 GetWorkingDir().Append(kReferenceYuvFileName), |
389 GetWorkingDir().Append(kStatsFileName))); | 397 GetWorkingDir().Append(kStatsFileName))); |
390 } | 398 } |
OLD | NEW |