| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |