Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(316)

Side by Side Diff: chrome/browser/media/webrtc_browsertest_common.cc

Issue 965403003: Making WebRTC quality tests less dependent on installed tools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor win fixes, improved error msg for rbga->i420, frame_analyzer Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "chrome/browser/media/webrtc_browsertest_common.h" 5 #include "chrome/browser/media/webrtc_browsertest_common.h"
6 6
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/test/test_timeouts.h" 10 #include "base/test/test_timeouts.h"
(...skipping 27 matching lines...) Expand all
38 38
39 const int kDefaultPollIntervalMsec = 250; 39 const int kDefaultPollIntervalMsec = 250;
40 40
41 base::FilePath GetReferenceFilesDir() { 41 base::FilePath GetReferenceFilesDir() {
42 base::FilePath test_data_dir; 42 base::FilePath test_data_dir;
43 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir); 43 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir);
44 44
45 return test_data_dir.Append(kReferenceFilesDirName); 45 return test_data_dir.Append(kReferenceFilesDirName);
46 } 46 }
47 47
48 base::FilePath GetToolForPlatform(const std::string& tool_name) {
49 base::FilePath tools_dir =
50 GetReferenceFilesDir().Append(FILE_PATH_LITERAL("tools"));
51 #if defined(OS_WIN)
52 return tools_dir
53 .Append(FILE_PATH_LITERAL("win"))
54 .AppendASCII(tool_name)
55 .AddExtension(FILE_PATH_LITERAL("exe"));
56 #elif defined(OS_MACOSX)
57 return tools_dir.Append(FILE_PATH_LITERAL("mac")).AppendASCII(tool_name);
58 #elif defined(OS_LINUX)
59 return tools_dir.Append(FILE_PATH_LITERAL("linux")).AppendASCII(tool_name);
60 #else
61 CHECK(false) << "Can't retrieve tool " << tool_name << " on this platform.";
62 return base::FilePath();
63 #endif
64 }
65
48 bool HasReferenceFilesInCheckout() { 66 bool HasReferenceFilesInCheckout() {
49 if (!base::PathExists(GetReferenceFilesDir())) { 67 if (!base::PathExists(GetReferenceFilesDir())) {
50 LOG(ERROR) 68 LOG(ERROR)
51 << "Cannot find the working directory for the reference video " 69 << "Cannot find the working directory for the reference video "
52 << "files, expected at " << GetReferenceFilesDir().value() << ". " << 70 << "files, expected at " << GetReferenceFilesDir().value() << ". " <<
53 kAdviseOnGclientSolution; 71 kAdviseOnGclientSolution;
54 return false; 72 return false;
55 } 73 }
56 return HasYuvAndY4mFile(test::kReferenceFileName360p) && 74 return HasYuvAndY4mFile(test::kReferenceFileName360p) &&
57 HasYuvAndY4mFile(test::kReferenceFileName720p); 75 HasYuvAndY4mFile(test::kReferenceFileName720p);
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 } 144 }
127 } 145 }
128 LOG(ERROR) 146 LOG(ERROR)
129 << "Timed out while waiting for " << javascript 147 << "Timed out while waiting for " << javascript
130 << " to evaluate to " << evaluates_to << "; last result was '" << result 148 << " to evaluate to " << evaluates_to << "; last result was '" << result
131 << "'"; 149 << "'";
132 return false; 150 return false;
133 } 151 }
134 152
135 } // namespace test 153 } // namespace test
OLDNEW
« no previous file with comments | « chrome/browser/media/webrtc_browsertest_common.h ('k') | chrome/test/data/webrtc/resources/tools/libgomp-1.dll.sha1 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698