OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/proxy/proxy_resolver_v8_tracing.h" | 5 #include "net/proxy/proxy_resolver_v8_tracing.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 scoped_refptr<ProxyResolverScriptData> LoadScriptData(const char* filename) { | 42 scoped_refptr<ProxyResolverScriptData> LoadScriptData(const char* filename) { |
43 base::FilePath path; | 43 base::FilePath path; |
44 PathService::Get(base::DIR_SOURCE_ROOT, &path); | 44 PathService::Get(base::DIR_SOURCE_ROOT, &path); |
45 path = path.AppendASCII("net"); | 45 path = path.AppendASCII("net"); |
46 path = path.AppendASCII("data"); | 46 path = path.AppendASCII("data"); |
47 path = path.AppendASCII("proxy_resolver_v8_tracing_unittest"); | 47 path = path.AppendASCII("proxy_resolver_v8_tracing_unittest"); |
48 path = path.AppendASCII(filename); | 48 path = path.AppendASCII(filename); |
49 | 49 |
50 // Try to read the file from disk. | 50 // Try to read the file from disk. |
51 std::string file_contents; | 51 std::string file_contents; |
52 bool ok = file_util::ReadFileToString(path, &file_contents); | 52 bool ok = base::ReadFileToString(path, &file_contents); |
53 | 53 |
54 // If we can't load the file from disk, something is misconfigured. | 54 // If we can't load the file from disk, something is misconfigured. |
55 EXPECT_TRUE(ok) << "Failed to read file: " << path.value(); | 55 EXPECT_TRUE(ok) << "Failed to read file: " << path.value(); |
56 | 56 |
57 // Load the PAC script into the ProxyResolver. | 57 // Load the PAC script into the ProxyResolver. |
58 return ProxyResolverScriptData::FromUTF8(file_contents); | 58 return ProxyResolverScriptData::FromUTF8(file_contents); |
59 } | 59 } |
60 | 60 |
61 void InitResolver(ProxyResolverV8Tracing* resolver, const char* filename) { | 61 void InitResolver(ProxyResolverV8Tracing* resolver, const char* filename) { |
62 TestCompletionCallback callback; | 62 TestCompletionCallback callback; |
(...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1090 proxy_uri.substr(0, proxy_uri.find(':') + 1)); | 1090 proxy_uri.substr(0, proxy_uri.find(':') + 1)); |
1091 } else { | 1091 } else { |
1092 NOTREACHED(); | 1092 NOTREACHED(); |
1093 } | 1093 } |
1094 } | 1094 } |
1095 } | 1095 } |
1096 | 1096 |
1097 } // namespace | 1097 } // namespace |
1098 | 1098 |
1099 } // namespace net | 1099 } // namespace net |
OLD | NEW |