Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1181)

Side by Side Diff: net/proxy/proxy_script_fetcher_impl_unittest.cc

Issue 10068021: Fix file access on Chrome for ChromeOS on Linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review changes Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/mock_cert_verifier.h" 13 #include "net/base/mock_cert_verifier.h"
14 #include "net/base/net_util.h" 14 #include "net/base/net_util.h"
15 #include "net/base/load_flags.h" 15 #include "net/base/load_flags.h"
16 #include "net/base/ssl_config_service_defaults.h" 16 #include "net/base/ssl_config_service_defaults.h"
17 #include "net/base/test_completion_callback.h" 17 #include "net/base/test_completion_callback.h"
18 #include "net/disk_cache/disk_cache.h" 18 #include "net/disk_cache/disk_cache.h"
19 #include "net/http/http_cache.h" 19 #include "net/http/http_cache.h"
20 #include "net/http/http_network_session.h" 20 #include "net/http/http_network_session.h"
21 #include "net/http/http_server_properties_impl.h" 21 #include "net/http/http_server_properties_impl.h"
22 #include "net/test/test_server.h" 22 #include "net/test/test_server.h"
23 #include "net/url_request/url_request_context_storage.h" 23 #include "net/url_request/url_request_context_storage.h"
24 #include "net/url_request/url_request_file_job.h"
24 #include "net/url_request/url_request_job_factory.h" 25 #include "net/url_request/url_request_job_factory.h"
25 #include "net/url_request/url_request_test_util.h" 26 #include "net/url_request/url_request_test_util.h"
26 #include "testing/gtest/include/gtest/gtest.h" 27 #include "testing/gtest/include/gtest/gtest.h"
27 #include "testing/platform_test.h" 28 #include "testing/platform_test.h"
28 29
29 namespace net { 30 namespace net {
30 31
31 // TODO(eroman): 32 // TODO(eroman):
32 // - Test canceling an outstanding request. 33 // - Test canceling an outstanding request.
33 // - Test deleting ProxyScriptFetcher while a request is in progress. 34 // - Test deleting ProxyScriptFetcher while a request is in progress.
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 119
119 class ProxyScriptFetcherImplTest : public PlatformTest { 120 class ProxyScriptFetcherImplTest : public PlatformTest {
120 public: 121 public:
121 ProxyScriptFetcherImplTest() 122 ProxyScriptFetcherImplTest()
122 : test_server_(TestServer::TYPE_HTTP, 123 : test_server_(TestServer::TYPE_HTTP,
123 net::TestServer::kLocalhost, 124 net::TestServer::kLocalhost,
124 FilePath(kDocRoot)) { 125 FilePath(kDocRoot)) {
125 } 126 }
126 127
127 static void SetUpTestCase() { 128 static void SetUpTestCase() {
128 URLRequest::AllowFileAccess(); 129 URLRequestFileJob::AllowAccessToAllFiles();
129 } 130 }
130 131
131 protected: 132 protected:
132 TestServer test_server_; 133 TestServer test_server_;
133 }; 134 };
134 135
135 TEST_F(ProxyScriptFetcherImplTest, FileUrl) { 136 TEST_F(ProxyScriptFetcherImplTest, FileUrl) {
136 scoped_refptr<URLRequestContext> context(new RequestContext); 137 scoped_refptr<URLRequestContext> context(new RequestContext);
137 ProxyScriptFetcherImpl pac_fetcher(context); 138 ProxyScriptFetcherImpl pac_fetcher(context);
138 139
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 { 410 {
410 GURL url(kEncodedUrlBroken); 411 GURL url(kEncodedUrlBroken);
411 string16 text; 412 string16 text;
412 TestCompletionCallback callback; 413 TestCompletionCallback callback;
413 int result = pac_fetcher.Fetch(url, &text, callback.callback()); 414 int result = pac_fetcher.Fetch(url, &text, callback.callback());
414 EXPECT_EQ(ERR_FAILED, result); 415 EXPECT_EQ(ERR_FAILED, result);
415 } 416 }
416 } 417 }
417 418
418 } // namespace net 419 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698