#include "net/test/test_data_directory.h"
#include "base/base_paths.h"
#include "base/path_service.h"
#include "base/threading/thread_restrictions.h"
namespace net {
namespace {
const base::FilePath::CharType kNetRelativePath[] = FILE_PATH_LITERAL("net");
const base::FilePath::CharType kNetDataRelativePath[] =
FILE_PATH_LITERAL("data");
const base::FilePath::CharType kCertificateDataSubPath[] =
FILE_PATH_LITERAL("ssl/certificates");
}
base::FilePath GetTestNetDirectory() {
base::FilePath src_root;
{
base::ScopedAllowBlockingForTesting allow_blocking;
base::PathService::Get(base::DIR_SRC_TEST_DATA_ROOT, &src_root);
}
return src_root.Append(kNetRelativePath);
}
base::FilePath GetTestNetDataDirectory() {
return GetTestNetDirectory().Append(kNetDataRelativePath);
}
base::FilePath GetTestCertsDirectory() {
return GetTestNetDataDirectory().Append(kCertificateDataSubPath);
}
base::FilePath GetTestClientCertsDirectory() {
return base::FilePath(kNetDataRelativePath).Append(kCertificateDataSubPath);
}
}