| Index: net/url_request/url_request_job_unittest.cc
|
| diff --git a/net/url_request/url_request_job_unittest.cc b/net/url_request/url_request_job_unittest.cc
|
| index 354915fe12be37c8ea2c0d16d74e2e80b1e3c796..5f63b0927de2918acbad499ce8d43dc18b849d45 100644
|
| --- a/net/url_request/url_request_job_unittest.cc
|
| +++ b/net/url_request/url_request_job_unittest.cc
|
| @@ -37,6 +37,24 @@ const MockTransaction kGZip_Transaction = {
|
| net::OK
|
| };
|
|
|
| +const MockTransaction kRedirect_Transaction = {
|
| + "http://www.google.com/redirect",
|
| + "GET",
|
| + base::Time(),
|
| + "",
|
| + net::LOAD_NORMAL,
|
| + "HTTP/1.1 302 Found",
|
| + "Cache-Control: max-age=10000\n"
|
| + "Location: http://www.google.com/destination\n"
|
| + "Content-Length: 5\n",
|
| + base::Time(),
|
| + "hello",
|
| + TEST_MODE_NORMAL,
|
| + NULL,
|
| + 0,
|
| + net::OK
|
| +};
|
| +
|
| } // namespace
|
|
|
| TEST(URLRequestJob, TransactionNotifiedWhenDone) {
|
| @@ -78,3 +96,22 @@ TEST(URLRequestJob, SyncTransactionNotifiedWhenDone) {
|
|
|
| RemoveMockTransaction(&transaction);
|
| }
|
| +
|
| +TEST(URLRequestJob, RedirectTransactionNotifiedWhenDone) {
|
| + MockNetworkLayer network_layer;
|
| + net::TestURLRequestContext context;
|
| + context.set_http_transaction_factory(&network_layer);
|
| +
|
| + net::TestDelegate d;
|
| + net::TestURLRequest req(GURL(kRedirect_Transaction.url), &d, &context, NULL);
|
| + AddMockTransaction(&kRedirect_Transaction);
|
| +
|
| + req.set_method("GET");
|
| + req.Start();
|
| +
|
| + base::MessageLoop::current()->Run();
|
| +
|
| + EXPECT_TRUE(network_layer.done_reading_called());
|
| +
|
| + RemoveMockTransaction(&kRedirect_Transaction);
|
| +}
|
|
|