OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/signin/core/browser/signin_error_controller.h" | 5 #include "components/signin/core/browser/signin_error_controller.h" |
6 | 6 |
7 #include <functional> | 7 #include <functional> |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "components/signin/core/browser/fake_auth_status_provider.h" | 10 #include "components/signin/core/browser/fake_auth_status_provider.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 | 12 |
13 static const char kTestAccountId[] = "testuser@test.com"; | 13 static const char kTestAccountId[] = "testuser@test.com"; |
14 static const char kTestUsername[] = "testuser@test.com"; | 14 static const char kTestUsername[] = "testuser@test.com"; |
15 static const char kOtherTestAccountId[] = "otheruser@test.com"; | 15 static const char kOtherTestAccountId[] = "otheruser@test.com"; |
16 static const char kOtherTestUsername[] = "otheruser@test.com"; | 16 static const char kOtherTestUsername[] = "otheruser@test.com"; |
17 | 17 |
18 class SigninErrorControllerTest : public testing::Test { | 18 class SigninErrorControllerTest : public testing::Test { |
19 public: | 19 public: |
20 virtual void SetUp() override { | 20 void SetUp() override { |
21 error_controller_.reset(new SigninErrorController()); | 21 error_controller_.reset(new SigninErrorController()); |
22 } | 22 } |
23 | 23 |
24 scoped_ptr<SigninErrorController> error_controller_; | 24 scoped_ptr<SigninErrorController> error_controller_; |
25 }; | 25 }; |
26 | 26 |
27 TEST_F(SigninErrorControllerTest, NoErrorAuthStatusProviders) { | 27 TEST_F(SigninErrorControllerTest, NoErrorAuthStatusProviders) { |
28 scoped_ptr<FakeAuthStatusProvider> provider; | 28 scoped_ptr<FakeAuthStatusProvider> provider; |
29 | 29 |
30 // No providers. | 30 // No providers. |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 GoogleServiceAuthError::NONE)); | 263 GoogleServiceAuthError::NONE)); |
264 ASSERT_EQ(GoogleServiceAuthError::UNEXPECTED_SERVICE_RESPONSE, | 264 ASSERT_EQ(GoogleServiceAuthError::UNEXPECTED_SERVICE_RESPONSE, |
265 error_controller_->auth_error().state()); | 265 error_controller_->auth_error().state()); |
266 ASSERT_STREQ(kTestAccountId, | 266 ASSERT_STREQ(kTestAccountId, |
267 error_controller_->error_account_id().c_str()); | 267 error_controller_->error_account_id().c_str()); |
268 | 268 |
269 fake_provider0.reset(); | 269 fake_provider0.reset(); |
270 fake_provider1.reset(); | 270 fake_provider1.reset(); |
271 ASSERT_FALSE(error_controller_->HasError()); | 271 ASSERT_FALSE(error_controller_->HasError()); |
272 } | 272 } |
OLD | NEW |