| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |