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

Side by Side Diff: net/url_request/url_request_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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shlobj.h> 9 #include <shlobj.h>
10 #endif 10 #endif
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 #include "net/http/http_network_layer.h" 47 #include "net/http/http_network_layer.h"
48 #include "net/http/http_network_session.h" 48 #include "net/http/http_network_session.h"
49 #include "net/http/http_request_headers.h" 49 #include "net/http/http_request_headers.h"
50 #include "net/http/http_response_headers.h" 50 #include "net/http/http_response_headers.h"
51 #include "net/ocsp/nss_ocsp.h" 51 #include "net/ocsp/nss_ocsp.h"
52 #include "net/proxy/proxy_service.h" 52 #include "net/proxy/proxy_service.h"
53 #include "net/socket/ssl_client_socket.h" 53 #include "net/socket/ssl_client_socket.h"
54 #include "net/test/test_server.h" 54 #include "net/test/test_server.h"
55 #include "net/url_request/url_request.h" 55 #include "net/url_request/url_request.h"
56 #include "net/url_request/url_request_file_dir_job.h" 56 #include "net/url_request/url_request_file_dir_job.h"
57 #include "net/url_request/url_request_file_job.h"
57 #include "net/url_request/url_request_http_job.h" 58 #include "net/url_request/url_request_http_job.h"
58 #include "net/url_request/url_request_job_factory.h" 59 #include "net/url_request/url_request_job_factory.h"
59 #include "net/url_request/url_request_redirect_job.h" 60 #include "net/url_request/url_request_redirect_job.h"
60 #include "net/url_request/url_request_test_job.h" 61 #include "net/url_request/url_request_test_job.h"
61 #include "net/url_request/url_request_test_util.h" 62 #include "net/url_request/url_request_test_util.h"
62 #include "testing/gtest/include/gtest/gtest.h" 63 #include "testing/gtest/include/gtest/gtest.h"
63 #include "testing/platform_test.h" 64 #include "testing/platform_test.h"
64 65
65 #if defined(OS_WIN) 66 #if defined(OS_WIN)
66 #include "base/win/windows_version.h" 67 #include "base/win/windows_version.h"
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 406
406 // Inherit PlatformTest since we require the autorelease pool on Mac OS X.f 407 // Inherit PlatformTest since we require the autorelease pool on Mac OS X.f
407 class URLRequestTest : public PlatformTest { 408 class URLRequestTest : public PlatformTest {
408 public: 409 public:
409 URLRequestTest() : default_context_(new TestURLRequestContext(true)) { 410 URLRequestTest() : default_context_(new TestURLRequestContext(true)) {
410 default_context_->set_network_delegate(&default_network_delegate_); 411 default_context_->set_network_delegate(&default_network_delegate_);
411 default_context_->Init(); 412 default_context_->Init();
412 } 413 }
413 414
414 static void SetUpTestCase() { 415 static void SetUpTestCase() {
415 URLRequest::AllowFileAccess(); 416 URLRequestFileJob::AllowAccessToAllFiles();
416 } 417 }
417 418
418 // Adds the TestJobInterceptor to the default context. 419 // Adds the TestJobInterceptor to the default context.
419 TestJobInterceptor* AddTestInterceptor() { 420 TestJobInterceptor* AddTestInterceptor() {
420 TestJobInterceptor* interceptor = new TestJobInterceptor(); 421 TestJobInterceptor* interceptor = new TestJobInterceptor();
421 default_context_->set_job_factory(&job_factory_); 422 default_context_->set_job_factory(&job_factory_);
422 job_factory_.AddInterceptor(interceptor); 423 job_factory_.AddInterceptor(interceptor);
423 return interceptor; 424 return interceptor;
424 } 425 }
425 426
(...skipping 4137 matching lines...) Expand 10 before | Expand all | Expand 10 after
4563 req.SetExtraRequestHeaders(headers); 4564 req.SetExtraRequestHeaders(headers);
4564 req.Start(); 4565 req.Start();
4565 MessageLoop::current()->Run(); 4566 MessageLoop::current()->Run();
4566 // If the net tests are being run with ChromeFrame then we need to allow for 4567 // If the net tests are being run with ChromeFrame then we need to allow for
4567 // the 'chromeframe' suffix which is added to the user agent before the 4568 // the 'chromeframe' suffix which is added to the user agent before the
4568 // closing parentheses. 4569 // closing parentheses.
4569 EXPECT_TRUE(StartsWithASCII(d.data_received(), "Lynx (textmode", true)); 4570 EXPECT_TRUE(StartsWithASCII(d.data_received(), "Lynx (textmode", true));
4570 } 4571 }
4571 4572
4572 } // namespace net 4573 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698