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()15std::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()23std::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