blob: b35392407bb2724cdc95d01aedbfa9b71930be6b [file] [log] [blame]
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#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 kCertificateRelativePath[] =
FILE_PATH_LITERAL("net/data/ssl/certificates");
} // namespace
base::FilePath GetTestCertsDirectory() {
base::FilePath src_root;
{
base::ThreadRestrictions::ScopedAllowIO allow_io_for_path_service;
PathService::Get(base::DIR_SOURCE_ROOT, &src_root);
}
return src_root.Append(kCertificateRelativePath);
}
base::FilePath GetTestClientCertsDirectory() {
#if defined(OS_ANDROID)
return base::FilePath(kCertificateRelativePath);
#else
return GetTestCertsDirectory();
#endif
}
base::FilePath GetWebSocketTestDataDirectory() {
base::FilePath data_dir(FILE_PATH_LITERAL("net/data/websocket"));
return data_dir;
}
} // namespace net