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

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

Issue 12310075: Cache failover to LOAD_PREFERRING_CACHE if network response suggests offline. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporated comments. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « net/http/http_transaction_unittest.cc ('k') | no next file » | 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) 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_job.h" 5 #include "net/url_request/url_request_job.h"
6 6
7 #include "net/http/http_transaction_unittest.h" 7 #include "net/http/http_transaction_unittest.h"
8 #include "net/url_request/url_request_test_util.h" 8 #include "net/url_request/url_request_test_util.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 15 matching lines...) Expand all
26 "", 26 "",
27 net::LOAD_NORMAL, 27 net::LOAD_NORMAL,
28 "HTTP/1.1 200 OK", 28 "HTTP/1.1 200 OK",
29 "Cache-Control: max-age=10000\n" 29 "Cache-Control: max-age=10000\n"
30 "Content-Encoding: gzip\n" 30 "Content-Encoding: gzip\n"
31 "Content-Length: 30\n", // Intentionally wrong. 31 "Content-Length: 30\n", // Intentionally wrong.
32 base::Time(), 32 base::Time(),
33 "", 33 "",
34 TEST_MODE_NORMAL, 34 TEST_MODE_NORMAL,
35 &GZipServer, 35 &GZipServer,
36 0 36 0,
37 net::OK
37 }; 38 };
38 39
39 } // namespace 40 } // namespace
40 41
41 TEST(URLRequestJob, TransactionNotifiedWhenDone) { 42 TEST(URLRequestJob, TransactionNotifiedWhenDone) {
42 MockNetworkLayer network_layer; 43 MockNetworkLayer network_layer;
43 net::TestURLRequestContext context; 44 net::TestURLRequestContext context;
44 context.set_http_transaction_factory(&network_layer); 45 context.set_http_transaction_factory(&network_layer);
45 46
46 net::TestDelegate d; 47 net::TestDelegate d;
(...skipping 23 matching lines...) Expand all
70 71
71 req.set_method("GET"); 72 req.set_method("GET");
72 req.Start(); 73 req.Start();
73 74
74 MessageLoop::current()->Run(); 75 MessageLoop::current()->Run();
75 76
76 EXPECT_TRUE(network_layer.done_reading_called()); 77 EXPECT_TRUE(network_layer.done_reading_called());
77 78
78 RemoveMockTransaction(&transaction); 79 RemoveMockTransaction(&transaction);
79 } 80 }
OLDNEW
« no previous file with comments | « net/http/http_transaction_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698