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

Unified Diff: net/http/http_network_layer_unittest.cc

Issue 222009: Replace some net::ERR_FAILED generic error codes with more specific codes.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Address wtc's comments Created 11 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_network_layer.cc ('k') | net/http/http_transaction_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « net/http/http_network_layer.cc ('k') | net/http/http_transaction_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698