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

Side by Side Diff: net/url_request/url_request_context_builder_unittest.cc

Issue 1003953008: Remove prerender cookie store, part 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prerender-revert-cookie-store-3
Patch Set: rebase (just in case since this is so huge) Created 5 years, 9 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
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/url_request/url_request_context_builder.h" 5 #include "net/url_request/url_request_context_builder.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "net/base/request_priority.h" 9 #include "net/base/request_priority.h"
10 #include "net/http/http_auth_handler.h" 10 #include "net/http/http_auth_handler.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 LocalHttpTestServer test_server_; 74 LocalHttpTestServer test_server_;
75 URLRequestContextBuilder builder_; 75 URLRequestContextBuilder builder_;
76 }; 76 };
77 77
78 TEST_F(URLRequestContextBuilderTest, DefaultSettings) { 78 TEST_F(URLRequestContextBuilderTest, DefaultSettings) {
79 ASSERT_TRUE(test_server_.Start()); 79 ASSERT_TRUE(test_server_.Start());
80 80
81 scoped_ptr<URLRequestContext> context(builder_.Build()); 81 scoped_ptr<URLRequestContext> context(builder_.Build());
82 TestDelegate delegate; 82 TestDelegate delegate;
83 scoped_ptr<URLRequest> request( 83 scoped_ptr<URLRequest> request(context->CreateRequest(
84 context->CreateRequest(test_server_.GetURL("echoheader?Foo"), 84 test_server_.GetURL("echoheader?Foo"), DEFAULT_PRIORITY, &delegate));
85 DEFAULT_PRIORITY,
86 &delegate,
87 context->cookie_store()));
88 request->set_method("GET"); 85 request->set_method("GET");
89 request->SetExtraRequestHeaderByName("Foo", "Bar", false); 86 request->SetExtraRequestHeaderByName("Foo", "Bar", false);
90 request->Start(); 87 request->Start();
91 base::MessageLoop::current()->Run(); 88 base::MessageLoop::current()->Run();
92 EXPECT_EQ("Bar", delegate.data_received()); 89 EXPECT_EQ("Bar", delegate.data_received());
93 } 90 }
94 91
95 TEST_F(URLRequestContextBuilderTest, UserAgent) { 92 TEST_F(URLRequestContextBuilderTest, UserAgent) {
96 ASSERT_TRUE(test_server_.Start()); 93 ASSERT_TRUE(test_server_.Start());
97 94
98 builder_.set_user_agent("Bar"); 95 builder_.set_user_agent("Bar");
99 scoped_ptr<URLRequestContext> context(builder_.Build()); 96 scoped_ptr<URLRequestContext> context(builder_.Build());
100 TestDelegate delegate; 97 TestDelegate delegate;
101 scoped_ptr<URLRequest> request( 98 scoped_ptr<URLRequest> request(
102 context->CreateRequest(test_server_.GetURL("echoheader?User-Agent"), 99 context->CreateRequest(test_server_.GetURL("echoheader?User-Agent"),
103 DEFAULT_PRIORITY, 100 DEFAULT_PRIORITY, &delegate));
104 &delegate,
105 NULL));
106 request->set_method("GET"); 101 request->set_method("GET");
107 request->Start(); 102 request->Start();
108 base::MessageLoop::current()->Run(); 103 base::MessageLoop::current()->Run();
109 EXPECT_EQ("Bar", delegate.data_received()); 104 EXPECT_EQ("Bar", delegate.data_received());
110 } 105 }
111 106
112 TEST_F(URLRequestContextBuilderTest, ExtraHttpAuthHandlerFactory) { 107 TEST_F(URLRequestContextBuilderTest, ExtraHttpAuthHandlerFactory) {
113 GURL gurl("www.google.com"); 108 GURL gurl("www.google.com");
114 const int kBasicReturnCode = net::OK; 109 const int kBasicReturnCode = net::OK;
115 MockHttpAuthHandlerFactory* mock_factory_basic = 110 MockHttpAuthHandlerFactory* mock_factory_basic =
(...skipping 11 matching lines...) Expand all
127 &handler)); 122 &handler));
128 // Verify that a handler isn't returned for a bogus scheme. 123 // Verify that a handler isn't returned for a bogus scheme.
129 EXPECT_EQ(ERR_UNSUPPORTED_AUTH_SCHEME, 124 EXPECT_EQ(ERR_UNSUPPORTED_AUTH_SCHEME,
130 context->http_auth_handler_factory()->CreateAuthHandlerFromString( 125 context->http_auth_handler_factory()->CreateAuthHandlerFromString(
131 "Bogus", HttpAuth::AUTH_SERVER, gurl, BoundNetLog(), &handler)); 126 "Bogus", HttpAuth::AUTH_SERVER, gurl, BoundNetLog(), &handler));
132 } 127 }
133 128
134 } // namespace 129 } // namespace
135 130
136 } // namespace net 131 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_context.cc ('k') | net/url_request/url_request_file_job_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698