xref: /aosp_15_r20/external/cronet/net/third_party/quiche/overrides/quiche_platform_impl/quiche_test_impl.cc (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2021 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "quiche_platform_impl/quiche_test_impl.h"
6 
7 #include <string>
8 
9 #include "base/files/file_path.h"
10 #include "base/path_service.h"
11 #include "net/test/test_data_directory.h"
12 
13 namespace quiche::test {
14 
QuicheGetCommonSourcePathImpl()15 std::string QuicheGetCommonSourcePathImpl() {
16   base::FilePath net_path = net::GetTestNetDirectory();
17   return net_path.AppendASCII("third_party/quiche/src/quiche/common")
18       .MaybeAsASCII();
19 }
20 
21 }  // namespace quiche::test
22 
QuicheGetTestMemoryCachePathImpl()23 std::string QuicheGetTestMemoryCachePathImpl() {
24   base::FilePath path;
25   base::PathService::Get(base::DIR_SRC_TEST_DATA_ROOT, &path);
26   path = path.AppendASCII("net").AppendASCII("data").AppendASCII(
27       "quic_http_response_cache_data");
28   // The file path is known to be an ascii string.
29   return path.MaybeAsASCII();
30 }
31