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

Side by Side Diff: net/url_request/url_request_http_job_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
« no previous file with comments | « net/url_request/url_request_http_job.cc ('k') | net/url_request/url_request_job.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_http_job.h" 5 #include "net/url_request/url_request_http_job.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 protected: 45 protected:
46 ~TestURLRequestHttpJob() override {} 46 ~TestURLRequestHttpJob() override {}
47 }; 47 };
48 48
49 class URLRequestHttpJobTest : public ::testing::Test { 49 class URLRequestHttpJobTest : public ::testing::Test {
50 protected: 50 protected:
51 URLRequestHttpJobTest() 51 URLRequestHttpJobTest()
52 : req_(context_.CreateRequest(GURL("http://www.example.com"), 52 : req_(context_.CreateRequest(GURL("http://www.example.com"),
53 DEFAULT_PRIORITY, 53 DEFAULT_PRIORITY,
54 &delegate_, 54 &delegate_)) {
55 nullptr)) {
56 context_.set_http_transaction_factory(&network_layer_); 55 context_.set_http_transaction_factory(&network_layer_);
57 } 56 }
58 57
59 bool TransactionAcceptsSdchEncoding() { 58 bool TransactionAcceptsSdchEncoding() {
60 base::WeakPtr<MockNetworkTransaction> transaction( 59 base::WeakPtr<MockNetworkTransaction> transaction(
61 network_layer_.last_transaction()); 60 network_layer_.last_transaction());
62 EXPECT_TRUE(transaction); 61 EXPECT_TRUE(transaction);
63 if (!transaction) return false; 62 if (!transaction) return false;
64 63
65 const HttpRequestInfo* request_info = transaction->request(); 64 const HttpRequestInfo* request_info = transaction->request();
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 MockClientSocketFactory socket_factory_; 203 MockClientSocketFactory socket_factory_;
205 TestURLRequestContext context_; 204 TestURLRequestContext context_;
206 }; 205 };
207 206
208 class URLRequestHttpJobWebSocketTest 207 class URLRequestHttpJobWebSocketTest
209 : public URLRequestHttpJobWebSocketTestBase { 208 : public URLRequestHttpJobWebSocketTestBase {
210 protected: 209 protected:
211 URLRequestHttpJobWebSocketTest() 210 URLRequestHttpJobWebSocketTest()
212 : req_(context_.CreateRequest(GURL("ws://www.example.com"), 211 : req_(context_.CreateRequest(GURL("ws://www.example.com"),
213 DEFAULT_PRIORITY, 212 DEFAULT_PRIORITY,
214 &delegate_, 213 &delegate_)) {
215 nullptr)) {
216 // The TestNetworkDelegate expects a call to NotifyBeforeURLRequest before 214 // The TestNetworkDelegate expects a call to NotifyBeforeURLRequest before
217 // anything else happens. 215 // anything else happens.
218 GURL url("ws://localhost/"); 216 GURL url("ws://localhost/");
219 TestCompletionCallback dummy; 217 TestCompletionCallback dummy;
220 network_delegate_.NotifyBeforeURLRequest( 218 network_delegate_.NotifyBeforeURLRequest(
221 req_.get(), dummy.callback(), &url); 219 req_.get(), dummy.callback(), &url);
222 } 220 }
223 221
224 TestDelegate delegate_; 222 TestDelegate delegate_;
225 scoped_ptr<URLRequest> req_; 223 scoped_ptr<URLRequest> req_;
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 req_->SetLoadFlags(LOAD_DISABLE_CACHE); 342 req_->SetLoadFlags(LOAD_DISABLE_CACHE);
345 job->Start(); 343 job->Start();
346 base::RunLoop().RunUntilIdle(); 344 base::RunLoop().RunUntilIdle();
347 EXPECT_EQ(URLRequestStatus::IO_PENDING, req_->status().status()); 345 EXPECT_EQ(URLRequestStatus::IO_PENDING, req_->status().status());
348 EXPECT_TRUE(fake_handshake_stream->initialize_stream_was_called()); 346 EXPECT_TRUE(fake_handshake_stream->initialize_stream_was_called());
349 } 347 }
350 348
351 } // namespace 349 } // namespace
352 350
353 } // namespace net 351 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_http_job.cc ('k') | net/url_request/url_request_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698