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

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: Fix net unittests Created 8 years, 7 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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 }; 404 };
405 405
406 // Inherit PlatformTest since we require the autorelease pool on Mac OS X.f 406 // Inherit PlatformTest since we require the autorelease pool on Mac OS X.f
407 class URLRequestTest : public PlatformTest { 407 class URLRequestTest : public PlatformTest {
408 public: 408 public:
409 URLRequestTest() : default_context_(new TestURLRequestContext(true)) { 409 URLRequestTest() : default_context_(new TestURLRequestContext(true)) {
410 default_context_->set_network_delegate(&default_network_delegate_); 410 default_context_->set_network_delegate(&default_network_delegate_);
411 default_context_->Init(); 411 default_context_->Init();
412 } 412 }
413 413
414 static void SetUpTestCase() {
415 URLRequest::AllowFileAccess();
416 }
417
418 // Adds the TestJobInterceptor to the default context. 414 // Adds the TestJobInterceptor to the default context.
419 TestJobInterceptor* AddTestInterceptor() { 415 TestJobInterceptor* AddTestInterceptor() {
420 TestJobInterceptor* interceptor = new TestJobInterceptor(); 416 TestJobInterceptor* interceptor = new TestJobInterceptor();
421 default_context_->set_job_factory(&job_factory_); 417 default_context_->set_job_factory(&job_factory_);
422 job_factory_.AddInterceptor(interceptor); 418 job_factory_.AddInterceptor(interceptor);
423 return interceptor; 419 return interceptor;
424 } 420 }
425 421
426 protected: 422 protected:
427 TestNetworkDelegate default_network_delegate_; // must outlive URLRequest 423 TestNetworkDelegate default_network_delegate_; // must outlive URLRequest
(...skipping 4156 matching lines...) Expand 10 before | Expand all | Expand 10 after
4584 req.SetExtraRequestHeaders(headers); 4580 req.SetExtraRequestHeaders(headers);
4585 req.Start(); 4581 req.Start();
4586 MessageLoop::current()->Run(); 4582 MessageLoop::current()->Run();
4587 // If the net tests are being run with ChromeFrame then we need to allow for 4583 // If the net tests are being run with ChromeFrame then we need to allow for
4588 // the 'chromeframe' suffix which is added to the user agent before the 4584 // the 'chromeframe' suffix which is added to the user agent before the
4589 // closing parentheses. 4585 // closing parentheses.
4590 EXPECT_TRUE(StartsWithASCII(d.data_received(), "Lynx (textmode", true)); 4586 EXPECT_TRUE(StartsWithASCII(d.data_received(), "Lynx (textmode", true));
4591 } 4587 }
4592 4588
4593 } // namespace net 4589 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_test_util.cc ('k') | webkit/tools/test_shell/simple_resource_loader_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698