OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_script_fetcher_impl.h" | 5 #include "net/proxy/proxy_script_fetcher_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
13 #include "net/base/net_util.h" | 13 #include "net/base/net_util.h" |
14 #include "net/base/ssl_config_service_defaults.h" | 14 #include "net/base/ssl_config_service_defaults.h" |
15 #include "net/base/test_completion_callback.h" | 15 #include "net/base/test_completion_callback.h" |
16 #include "net/disk_cache/disk_cache.h" | 16 #include "net/disk_cache/disk_cache.h" |
17 #include "net/http/http_cache.h" | 17 #include "net/http/http_cache.h" |
18 #include "net/url_request/url_request_unittest.h" | 18 #include "net/url_request/url_request_test_util.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
20 #include "testing/platform_test.h" | 20 #include "testing/platform_test.h" |
21 | 21 |
22 // TODO(eroman): | 22 // TODO(eroman): |
23 // - Test canceling an outstanding request. | 23 // - Test canceling an outstanding request. |
24 // - Test deleting ProxyScriptFetcher while a request is in progress. | 24 // - Test deleting ProxyScriptFetcher while a request is in progress. |
25 | 25 |
26 const FilePath::CharType kDocRoot[] = | 26 const FilePath::CharType kDocRoot[] = |
27 FILE_PATH_LITERAL("net/data/proxy_script_fetcher_unittest"); | 27 FILE_PATH_LITERAL("net/data/proxy_script_fetcher_unittest"); |
28 | 28 |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 string16 text; | 326 string16 text; |
327 TestCompletionCallback callback; | 327 TestCompletionCallback callback; |
328 int result = pac_fetcher.Fetch(url, &text, &callback); | 328 int result = pac_fetcher.Fetch(url, &text, &callback); |
329 EXPECT_EQ(ERR_IO_PENDING, result); | 329 EXPECT_EQ(ERR_IO_PENDING, result); |
330 EXPECT_EQ(OK, callback.WaitForResult()); | 330 EXPECT_EQ(OK, callback.WaitForResult()); |
331 EXPECT_EQ(ASCIIToUTF16("This was encoded as UTF-16BE.\n"), text); | 331 EXPECT_EQ(ASCIIToUTF16("This was encoded as UTF-16BE.\n"), text); |
332 } | 332 } |
333 } | 333 } |
334 | 334 |
335 } // namespace net | 335 } // namespace net |
OLD | NEW |