| 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 | |
| 41 static const base::FilePath::CharType kFrameAnalyzerExecutable[] = | 33 static const base::FilePath::CharType kFrameAnalyzerExecutable[] = |
| 42 #if defined(OS_WIN) | 34 #if defined(OS_WIN) |
| 43 FILE_PATH_LITERAL("frame_analyzer.exe"); | 35 FILE_PATH_LITERAL("frame_analyzer.exe"); |
| 44 #else | 36 #else |
| 45 FILE_PATH_LITERAL("frame_analyzer"); | 37 FILE_PATH_LITERAL("frame_analyzer"); |
| 46 #endif | 38 #endif |
| 47 | 39 |
| 48 static const base::FilePath::CharType kArgbToI420ConverterExecutable[] = | 40 static const base::FilePath::CharType kArgbToI420ConverterExecutable[] = |
| 49 #if defined(OS_WIN) | 41 #if defined(OS_WIN) |
| 50 FILE_PATH_LITERAL("rgba_to_i420_converter.exe"); | 42 FILE_PATH_LITERAL("rgba_to_i420_converter.exe"); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // * zxing (see the CPP version at https://code.google.com/p/zxing) | 85 // * zxing (see the CPP version at https://code.google.com/p/zxing) |
| 94 // * ffmpeg 0.11.1 or compatible version (see http://www.ffmpeg.org) | 86 // * ffmpeg 0.11.1 or compatible version (see http://www.ffmpeg.org) |
| 95 // | 87 // |
| 96 // The test case will launch a custom binary (peerconnection_server) which will | 88 // The test case will launch a custom binary (peerconnection_server) which will |
| 97 // allow two WebRTC clients to find each other. | 89 // allow two WebRTC clients to find each other. |
| 98 // | 90 // |
| 99 // The test also runs several other custom binaries - rgba_to_i420 converter and | 91 // The test also runs several other custom binaries - rgba_to_i420 converter and |
| 100 // frame_analyzer. Both tools can be found under third_party/webrtc/tools. The | 92 // frame_analyzer. Both tools can be found under third_party/webrtc/tools. The |
| 101 // test also runs a stand alone Python implementation of a WebSocket server | 93 // test also runs a stand alone Python implementation of a WebSocket server |
| 102 // (pywebsocket) and a barcode_decoder script. | 94 // (pywebsocket) and a barcode_decoder script. |
| 103 class MAYBE_WebrtcVideoQualityBrowserTest : public WebRtcTestBase { | 95 class WebrtcVideoQualityBrowserTest : public WebRtcTestBase { |
| 104 public: | 96 public: |
| 105 MAYBE_WebrtcVideoQualityBrowserTest() | 97 WebrtcVideoQualityBrowserTest() |
| 106 : pywebsocket_server_(0), | 98 : pywebsocket_server_(0), |
| 107 environment_(base::Environment::Create()) {} | 99 environment_(base::Environment::Create()) {} |
| 108 | 100 |
| 109 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 101 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
| 110 PeerConnectionServerRunner::KillAllPeerConnectionServersOnCurrentSystem(); | 102 PeerConnectionServerRunner::KillAllPeerConnectionServersOnCurrentSystem(); |
| 111 } | 103 } |
| 112 | 104 |
| 113 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 105 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 114 // This test expects real device handling and requires a real webcam / audio | 106 // This test expects real device handling and requires a real webcam / audio |
| 115 // device; it will not work with fake devices. | 107 // device; it will not work with fake devices. |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 base::FilePath GetBrowserDir() { | 316 base::FilePath GetBrowserDir() { |
| 325 base::FilePath browser_dir; | 317 base::FilePath browser_dir; |
| 326 EXPECT_TRUE(PathService::Get(base::DIR_MODULE, &browser_dir)); | 318 EXPECT_TRUE(PathService::Get(base::DIR_MODULE, &browser_dir)); |
| 327 return browser_dir; | 319 return browser_dir; |
| 328 } | 320 } |
| 329 | 321 |
| 330 base::ProcessHandle pywebsocket_server_; | 322 base::ProcessHandle pywebsocket_server_; |
| 331 scoped_ptr<base::Environment> environment_; | 323 scoped_ptr<base::Environment> environment_; |
| 332 }; | 324 }; |
| 333 | 325 |
| 334 IN_PROC_BROWSER_TEST_F(MAYBE_WebrtcVideoQualityBrowserTest, | 326 IN_PROC_BROWSER_TEST_F(WebrtcVideoQualityBrowserTest, |
| 335 MANUAL_TestVGAVideoQuality) { | 327 MANUAL_TestVGAVideoQuality) { |
| 336 ASSERT_TRUE(HasAllRequiredResources()); | 328 ASSERT_TRUE(HasAllRequiredResources()); |
| 337 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 329 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 338 ASSERT_TRUE(StartPyWebSocketServer()); | 330 ASSERT_TRUE(StartPyWebSocketServer()); |
| 339 ASSERT_TRUE(peerconnection_server_.Start()); | 331 ASSERT_TRUE(peerconnection_server_.Start()); |
| 340 | 332 |
| 341 ui_test_utils::NavigateToURL( | |
| 342 browser(), embedded_test_server()->GetURL(kMainWebrtcTestHtmlPage)); | |
| 343 content::WebContents* left_tab = | 333 content::WebContents* left_tab = |
| 344 browser()->tab_strip_model()->GetActiveWebContents(); | 334 OpenPageAndGetUserMediaInNewTab( |
| 345 GetUserMediaAndAccept(left_tab); | 335 embedded_test_server()->GetURL(kMainWebrtcTestHtmlPage)); |
| 346 | |
| 347 chrome::AddTabAt(browser(), GURL(), -1, true); | |
| 348 content::WebContents* right_tab = | 336 content::WebContents* right_tab = |
| 349 browser()->tab_strip_model()->GetActiveWebContents(); | 337 OpenPageAndGetUserMediaInNewTab( |
| 350 ui_test_utils::NavigateToURL( | 338 embedded_test_server()->GetURL(kCapturingWebrtcHtmlPage)); |
| 351 browser(), embedded_test_server()->GetURL(kCapturingWebrtcHtmlPage)); | |
| 352 GetUserMediaAndAccept(right_tab); | |
| 353 | 339 |
| 354 ConnectToPeerConnectionServer("peer 1", left_tab); | 340 ConnectToPeerConnectionServer("peer 1", left_tab); |
| 355 ConnectToPeerConnectionServer("peer 2", right_tab); | 341 ConnectToPeerConnectionServer("peer 2", right_tab); |
| 356 | 342 |
| 357 EstablishCall(left_tab, right_tab); | 343 EstablishCall(left_tab, right_tab); |
| 358 | 344 |
| 359 AssertNoAsynchronousErrors(left_tab); | 345 AssertNoAsynchronousErrors(left_tab); |
| 360 AssertNoAsynchronousErrors(right_tab); | 346 AssertNoAsynchronousErrors(right_tab); |
| 361 | 347 |
| 362 // Poll slower here to avoid flooding the log with messages: capturing and | 348 // Poll slower here to avoid flooding the log with messages: capturing and |
| (...skipping 26 matching lines...) Expand all Loading... |
| 389 | 375 |
| 390 RunARGBtoI420Converter( | 376 RunARGBtoI420Converter( |
| 391 kVgaWidth, kVgaHeight, GetWorkingDir().Append(kCapturedYuvFileName)); | 377 kVgaWidth, kVgaHeight, GetWorkingDir().Append(kCapturedYuvFileName)); |
| 392 ASSERT_TRUE( | 378 ASSERT_TRUE( |
| 393 CompareVideosAndPrintResult(kVgaWidth, | 379 CompareVideosAndPrintResult(kVgaWidth, |
| 394 kVgaHeight, | 380 kVgaHeight, |
| 395 GetWorkingDir().Append(kCapturedYuvFileName), | 381 GetWorkingDir().Append(kCapturedYuvFileName), |
| 396 GetWorkingDir().Append(kReferenceYuvFileName), | 382 GetWorkingDir().Append(kReferenceYuvFileName), |
| 397 GetWorkingDir().Append(kStatsFileName))); | 383 GetWorkingDir().Append(kStatsFileName))); |
| 398 } | 384 } |
| OLD | NEW |