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

Side by Side Diff: net/http/http_transaction_winhttp_unittest.cc

Issue 17635: Remove HttpTransactionWinHttp and the --winhttp command-line... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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_winhttp.cc ('k') | net/http/winhttp_request_throttle.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "net/http/http_transaction_winhttp.h"
6 #include "net/http/http_transaction_unittest.h"
7 #include "testing/gtest/include/gtest/gtest.h"
8
9 TEST(HttpTransactionWinHttp, CreateAndDestroy) {
10 scoped_ptr<net::ProxyService> proxy_service(net::ProxyService::CreateNull());
11 net::HttpTransactionWinHttp::Factory factory(proxy_service.get());
12
13 scoped_ptr<net::HttpTransaction> trans(factory.CreateTransaction());
14 }
15
16 TEST(HttpTransactionWinHttp, Suspend) {
17 scoped_ptr<net::ProxyService> proxy_service(net::ProxyService::CreateNull());
18 net::HttpTransactionWinHttp::Factory factory(proxy_service.get());
19
20 scoped_ptr<net::HttpTransaction> trans(factory.CreateTransaction());
21 trans.reset();
22
23 factory.Suspend(true);
24
25 trans.reset(factory.CreateTransaction());
26 ASSERT_TRUE(trans == NULL);
27
28 factory.Suspend(false);
29
30 trans.reset(factory.CreateTransaction());
31 }
32
33 TEST(HttpTransactionWinHttp, GoogleGET) {
34 scoped_ptr<net::ProxyService> proxy_service(net::ProxyService::CreateNull());
35 net::HttpTransactionWinHttp::Factory factory(proxy_service.get());
36 TestCompletionCallback callback;
37
38 scoped_ptr<net::HttpTransaction> trans(factory.CreateTransaction());
39
40 net::HttpRequestInfo request_info;
41 request_info.url = GURL("http://www.google.com/");
42 request_info.method = "GET";
43 request_info.user_agent = "Foo/1.0";
44 request_info.load_flags = net::LOAD_NORMAL;
45
46 int rv = trans->Start(&request_info, &callback);
47 if (rv == net::ERR_IO_PENDING)
48 rv = callback.WaitForResult();
49 EXPECT_EQ(net::OK, rv);
50
51 std::string contents;
52 rv = ReadTransaction(trans.get(), &contents);
53 EXPECT_EQ(net::OK, rv);
54 }
55
OLDNEW
« no previous file with comments | « net/http/http_transaction_winhttp.cc ('k') | net/http/winhttp_request_throttle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698