| Index: net/http/http_network_layer_unittest.cc
|
| ===================================================================
|
| --- net/http/http_network_layer_unittest.cc (revision 26789)
|
| +++ net/http/http_network_layer_unittest.cc (working copy)
|
| @@ -19,7 +19,10 @@
|
| NULL, new net::MockHostResolver, net::ProxyService::CreateNull(),
|
| new net::SSLConfigServiceDefaults);
|
|
|
| - scoped_ptr<net::HttpTransaction> trans(factory.CreateTransaction());
|
| + scoped_ptr<net::HttpTransaction> trans;
|
| + int rv = factory.CreateTransaction(&trans);
|
| + EXPECT_EQ(net::OK, rv);
|
| + EXPECT_TRUE(trans.get() != NULL);
|
| }
|
|
|
| TEST_F(HttpNetworkLayerTest, Suspend) {
|
| @@ -27,17 +30,23 @@
|
| NULL, new net::MockHostResolver, net::ProxyService::CreateNull(),
|
| new net::SSLConfigServiceDefaults);
|
|
|
| - scoped_ptr<net::HttpTransaction> trans(factory.CreateTransaction());
|
| + scoped_ptr<net::HttpTransaction> trans;
|
| + int rv = factory.CreateTransaction(&trans);
|
| + EXPECT_EQ(net::OK, rv);
|
| +
|
| trans.reset();
|
|
|
| factory.Suspend(true);
|
|
|
| - trans.reset(factory.CreateTransaction());
|
| + rv = factory.CreateTransaction(&trans);
|
| + EXPECT_EQ(net::ERR_NETWORK_IO_SUSPENDED, rv);
|
| +
|
| ASSERT_TRUE(trans == NULL);
|
|
|
| factory.Suspend(false);
|
|
|
| - trans.reset(factory.CreateTransaction());
|
| + rv = factory.CreateTransaction(&trans);
|
| + EXPECT_EQ(net::OK, rv);
|
| }
|
|
|
| TEST_F(HttpNetworkLayerTest, GET) {
|
| @@ -62,7 +71,9 @@
|
|
|
| TestCompletionCallback callback;
|
|
|
| - scoped_ptr<net::HttpTransaction> trans(factory.CreateTransaction());
|
| + scoped_ptr<net::HttpTransaction> trans;
|
| + int rv = factory.CreateTransaction(&trans);
|
| + EXPECT_EQ(net::OK, rv);
|
|
|
| net::HttpRequestInfo request_info;
|
| request_info.url = GURL("http://www.google.com/");
|
| @@ -70,7 +81,7 @@
|
| request_info.user_agent = "Foo/1.0";
|
| request_info.load_flags = net::LOAD_NORMAL;
|
|
|
| - int rv = trans->Start(&request_info, &callback, NULL);
|
| + rv = trans->Start(&request_info, &callback, NULL);
|
| if (rv == net::ERR_IO_PENDING)
|
| rv = callback.WaitForResult();
|
| ASSERT_EQ(net::OK, rv);
|
|
|