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

Side by Side Diff: net/url_request/url_request_ftp_job_unittest.cc

Issue 10855209: Refactoring: ProtocolHandler::MaybeCreateJob takes NetworkDelegate as argument (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Latest merge Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/url_request/url_request_ftp_job.cc ('k') | net/url_request/url_request_http_job.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/ftp/ftp_auth_cache.h" 5 #include "net/ftp/ftp_auth_cache.h"
6 #include "net/ftp/ftp_transaction.h" 6 #include "net/ftp/ftp_transaction.h"
7 #include "net/ftp/ftp_transaction_factory.h" 7 #include "net/ftp/ftp_transaction_factory.h"
8 #include "net/url_request/ftp_protocol_handler.h" 8 #include "net/url_request/ftp_protocol_handler.h"
9 #include "net/url_request/url_request.h" 9 #include "net/url_request/url_request.h"
10 #include "net/url_request/url_request_context.h" 10 #include "net/url_request/url_request_context.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 ::testing::StrictMock<MockFtpTransactionFactory> ftp_transaction_factory; 51 ::testing::StrictMock<MockFtpTransactionFactory> ftp_transaction_factory;
52 ::testing::StrictMock<MockURLRequestDelegate> delegate; 52 ::testing::StrictMock<MockURLRequestDelegate> delegate;
53 FtpAuthCache ftp_auth_cache; 53 FtpAuthCache ftp_auth_cache;
54 54
55 GURL url("ftp://example.com"); 55 GURL url("ftp://example.com");
56 URLRequestContext context; 56 URLRequestContext context;
57 URLRequest url_request(url, &delegate, &context); 57 URLRequest url_request(url, &delegate, &context);
58 58
59 FtpProtocolHandler ftp_protocol_handler( 59 FtpProtocolHandler ftp_protocol_handler(
60 NULL, &ftp_transaction_factory, &ftp_auth_cache); 60 &ftp_transaction_factory, &ftp_auth_cache);
61 61
62 scoped_refptr<URLRequestJob> ftp_job( 62 scoped_refptr<URLRequestJob> ftp_job(
63 ftp_protocol_handler.MaybeCreateJob(&url_request)); 63 ftp_protocol_handler.MaybeCreateJob(&url_request, NULL));
64 ASSERT_TRUE(ftp_job.get()); 64 ASSERT_TRUE(ftp_job.get());
65 65
66 EXPECT_CALL(ftp_transaction_factory, CreateTransaction()) 66 EXPECT_CALL(ftp_transaction_factory, CreateTransaction())
67 .WillOnce(Return(static_cast<FtpTransaction*>(NULL))); 67 .WillOnce(Return(static_cast<FtpTransaction*>(NULL)));
68 ftp_job->Start(); 68 ftp_job->Start();
69 EXPECT_CALL(delegate, OnResponseStarted(_)) 69 EXPECT_CALL(delegate, OnResponseStarted(_))
70 .WillOnce(HandleOnResponseStarted(URLRequestStatus::FAILED)); 70 .WillOnce(HandleOnResponseStarted(URLRequestStatus::FAILED));
71 MessageLoop::current()->RunAllPending(); 71 MessageLoop::current()->RunAllPending();
72 EXPECT_FALSE(url_request.is_pending()); 72 EXPECT_FALSE(url_request.is_pending());
73 } 73 }
74 74
75 } // namespace net 75 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_ftp_job.cc ('k') | net/url_request/url_request_http_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698