summaryrefslogtreecommitdiff
path: root/chromium/net/base/test_data_directory.cc
blob: 45fe638d4286b208510eabf950873e60e3ae8289 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// 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/base/test_data_directory.h"

#include "base/base_paths.h"
#include "base/path_service.h"

namespace net {

namespace {
const base::FilePath::CharType kCertificateRelativePath[] =
    FILE_PATH_LITERAL("net/data/ssl/certificates");
}  // namespace

base::FilePath GetTestCertsDirectory() {
  base::FilePath src_root;
  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