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

Side by Side Diff: jingle/notifier/communicator/single_login_attempt_unittest.cc

Issue 10831277: [net] Change factory methods for HostResolver and HostCache to return a scoped_ptr (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove unnecessary initialization; respond to review Created 8 years, 2 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 | « content/shell/shell_url_request_context_getter.cc ('k') | net/base/host_cache.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 "jingle/notifier/communicator/single_login_attempt.h" 5 #include "jingle/notifier/communicator/single_login_attempt.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 private: 67 private:
68 DelegateState state_; 68 DelegateState state_;
69 base::WeakPtr<buzz::XmppTaskParentInterface> base_task_; 69 base::WeakPtr<buzz::XmppTaskParentInterface> base_task_;
70 ServerInformation redirect_server_; 70 ServerInformation redirect_server_;
71 }; 71 };
72 72
73 class MyTestURLRequestContext : public TestURLRequestContext { 73 class MyTestURLRequestContext : public TestURLRequestContext {
74 public: 74 public:
75 MyTestURLRequestContext() : TestURLRequestContext(true) { 75 MyTestURLRequestContext() : TestURLRequestContext(true) {
76 context_storage_.set_host_resolver(new net::HangingHostResolver()); 76 context_storage_.set_host_resolver(
77 scoped_ptr<net::HostResolver>(new net::HangingHostResolver()));
77 Init(); 78 Init();
78 } 79 }
79 virtual ~MyTestURLRequestContext() {} 80 virtual ~MyTestURLRequestContext() {}
80 }; 81 };
81 82
82 class SingleLoginAttemptTest : public ::testing::Test { 83 class SingleLoginAttemptTest : public ::testing::Test {
83 protected: 84 protected:
84 SingleLoginAttemptTest() 85 SingleLoginAttemptTest()
85 : login_settings_( 86 : login_settings_(
86 buzz::XmppClientSettings(), 87 buzz::XmppClientSettings(),
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 // Fire 'Unauthorized' errors and make sure the delegate gets the 244 // Fire 'Unauthorized' errors and make sure the delegate gets the
244 // OnCredentialsRejected() event. 245 // OnCredentialsRejected() event.
245 TEST_F(SingleLoginAttemptTest, CredentialsRejected) { 246 TEST_F(SingleLoginAttemptTest, CredentialsRejected) {
246 attempt_.OnError(buzz::XmppEngine::ERROR_UNAUTHORIZED, 0, NULL); 247 attempt_.OnError(buzz::XmppEngine::ERROR_UNAUTHORIZED, 0, NULL);
247 EXPECT_EQ(CREDENTIALS_REJECTED, fake_delegate_.state()); 248 EXPECT_EQ(CREDENTIALS_REJECTED, fake_delegate_.state());
248 } 249 }
249 250
250 } // namespace 251 } // namespace
251 252
252 } // namespace notifier 253 } // namespace notifier
OLDNEW
« no previous file with comments | « content/shell/shell_url_request_context_getter.cc ('k') | net/base/host_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698