| 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/base64.h" | 5 #include "base/base64.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/environment.h" | 7 #include "base/environment.h" |
| 8 #include "base/files/file.h" | 8 #include "base/files/file.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 109 |
| 110 void SetUpCommandLine(base::CommandLine* command_line) override { | 110 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 111 // Set up the command line option with the expected file name. We will check | 111 // Set up the command line option with the expected file name. We will check |
| 112 // its existence in HasAllRequiredResources(). | 112 // its existence in HasAllRequiredResources(). |
| 113 webrtc_reference_video_y4m_ = test::GetReferenceFilesDir() | 113 webrtc_reference_video_y4m_ = test::GetReferenceFilesDir() |
| 114 .Append(test_config_.reference_video) | 114 .Append(test_config_.reference_video) |
| 115 .AddExtension(test::kY4mFileExtension); | 115 .AddExtension(test::kY4mFileExtension); |
| 116 command_line->AppendSwitchPath(switches::kUseFileForFakeVideoCapture, | 116 command_line->AppendSwitchPath(switches::kUseFileForFakeVideoCapture, |
| 117 webrtc_reference_video_y4m_); | 117 webrtc_reference_video_y4m_); |
| 118 command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream); | 118 command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream); |
| 119 |
| 120 // The video playback will not work without a GPU, so force its use here. |
| 121 command_line->AppendSwitch(switches::kUseGpuInTests); |
| 119 } | 122 } |
| 120 | 123 |
| 121 // Writes all frames we've captured so far by grabbing them from the | 124 // Writes all frames we've captured so far by grabbing them from the |
| 122 // javascript and writing them to the temporary work directory. | 125 // javascript and writing them to the temporary work directory. |
| 123 void WriteCapturedFramesToWorkingDir(content::WebContents* capturing_tab) { | 126 void WriteCapturedFramesToWorkingDir(content::WebContents* capturing_tab) { |
| 124 int num_frames = 0; | 127 int num_frames = 0; |
| 125 std::string response = | 128 std::string response = |
| 126 ExecuteJavascript("getTotalNumberCapturedFrames()", capturing_tab); | 129 ExecuteJavascript("getTotalNumberCapturedFrames()", capturing_tab); |
| 127 ASSERT_TRUE(base::StringToInt(response, &num_frames)) << | 130 ASSERT_TRUE(base::StringToInt(response, &num_frames)) << |
| 128 "Failed to retrieve frame count: got " << response; | 131 "Failed to retrieve frame count: got " << response; |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 ASSERT_TRUE(CompareVideosAndPrintResult( | 332 ASSERT_TRUE(CompareVideosAndPrintResult( |
| 330 test_config_.test_name, | 333 test_config_.test_name, |
| 331 test_config_.width, | 334 test_config_.width, |
| 332 test_config_.height, | 335 test_config_.height, |
| 333 GetWorkingDir().Append(kCapturedYuvFileName), | 336 GetWorkingDir().Append(kCapturedYuvFileName), |
| 334 test::GetReferenceFilesDir() | 337 test::GetReferenceFilesDir() |
| 335 .Append(test_config_.reference_video) | 338 .Append(test_config_.reference_video) |
| 336 .AddExtension(test::kYuvFileExtension), | 339 .AddExtension(test::kYuvFileExtension), |
| 337 GetWorkingDir().Append(kStatsFileName))); | 340 GetWorkingDir().Append(kStatsFileName))); |
| 338 } | 341 } |
| OLD | NEW |