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

Unified Diff: chrome/browser/media/webrtc_browsertest_common.cc

Issue 227633002: Fixed quality tests after PyAuto test purge. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: .gitignore'ing resource files Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/media/webrtc_browsertest_common.h ('k') | chrome/test/data/webrtc/resources/README » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/webrtc_browsertest_common.cc
diff --git a/chrome/browser/media/webrtc_browsertest_common.cc b/chrome/browser/media/webrtc_browsertest_common.cc
index 9928514ab178d56515d759ac89198adf9401914c..8eae1f8ad9cb5bdb41e35a25aeb89fc6e180c622 100644
--- a/chrome/browser/media/webrtc_browsertest_common.cc
+++ b/chrome/browser/media/webrtc_browsertest_common.cc
@@ -13,12 +13,14 @@
#include "base/time/time.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/common/chrome_paths.h"
#include "content/public/test/browser_test_utils.h"
namespace test {
-const base::FilePath::CharType kReferenceVideosDirName[] =
- FILE_PATH_LITERAL("webrtc.DEPS/webrtc_videos");
+// Relative to the chrome/test/data directory.
+const base::FilePath::CharType kReferenceFilesDirName[] =
+ FILE_PATH_LITERAL("webrtc/resources");
const base::FilePath::CharType kReferenceFileName360p[] =
FILE_PATH_LITERAL("reference_video_640x360_30fps");
const base::FilePath::CharType kYuvFileExtension[] = FILE_PATH_LITERAL("yuv");
@@ -36,33 +38,22 @@ static const char kAdviseOnGclientSolution[] =
const int kDefaultPollIntervalMsec = 250;
-base::FilePath GetReferenceVideosDir() {
- // FilePath does not tolerate relative paths, and we want to hang the
- // kReferenceVideosDirName at the same level as Chromium codebase, so we
- // need to subtract the trailing .../src manually from the path.
- const size_t src_token_length = 3u;
- const base::FilePath::StringType src_token(FILE_PATH_LITERAL("src"));
-
- base::FilePath source_dir;
- PathService::Get(base::DIR_SOURCE_ROOT, &source_dir);
-
- base::FilePath::StringType path = source_dir.value();
- DCHECK_GT(path.size(), src_token_length);
- std::size_t found = path.rfind(src_token);
- if (found != std::string::npos)
- path.erase(found, src_token_length);
- return base::FilePath(path).Append(kReferenceVideosDirName);
+base::FilePath GetReferenceFilesDir() {
+ base::FilePath test_data_dir;
+ PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir);
+
+ return test_data_dir.Append(kReferenceFilesDirName);
}
bool HasReferenceFilesInCheckout() {
- if (!base::PathExists(GetReferenceVideosDir())) {
+ if (!base::PathExists(GetReferenceFilesDir())) {
LOG(ERROR)
<< "Cannot find the working directory for the reference video "
- << "files, expected at " << GetReferenceVideosDir().value() << ". " <<
+ << "files, expected at " << GetReferenceFilesDir().value() << ". " <<
kAdviseOnGclientSolution;
return false;
}
- base::FilePath webrtc_reference_video_yuv = GetReferenceVideosDir()
+ base::FilePath webrtc_reference_video_yuv = GetReferenceFilesDir()
.Append(kReferenceFileName360p).AddExtension(kYuvFileExtension);
if (!base::PathExists(webrtc_reference_video_yuv)) {
LOG(ERROR)
@@ -72,7 +63,7 @@ bool HasReferenceFilesInCheckout() {
return false;
}
- base::FilePath webrtc_reference_video_y4m = GetReferenceVideosDir()
+ base::FilePath webrtc_reference_video_y4m = GetReferenceFilesDir()
.Append(kReferenceFileName360p).AddExtension(kY4mFileExtension);
if (!base::PathExists(webrtc_reference_video_y4m)) {
LOG(ERROR)
« no previous file with comments | « chrome/browser/media/webrtc_browsertest_common.h ('k') | chrome/test/data/webrtc/resources/README » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698