| 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 "chrome/browser/sync/sync_error_notifier_ash.h" | 5 #include "chrome/browser/sync/sync_error_notifier_ash.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 using ::testing::NiceMock; | 40 using ::testing::NiceMock; |
| 41 using ::testing::Return; | 41 using ::testing::Return; |
| 42 using ::testing::ReturnRef; | 42 using ::testing::ReturnRef; |
| 43 using ::testing::_; | 43 using ::testing::_; |
| 44 | 44 |
| 45 namespace ash { | 45 namespace ash { |
| 46 namespace test { | 46 namespace test { |
| 47 | 47 |
| 48 namespace { | 48 namespace { |
| 49 | 49 |
| 50 static const char kTestAccountId[] = "testuser@test.com"; | 50 const char kTestAccountId[] = "testuser@test.com"; |
| 51 | 51 |
| 52 // Notification ID corresponding to kProfileSyncNotificationId + kTestAccountId. | 52 // Notification ID corresponding to kProfileSyncNotificationId + kTestAccountId. |
| 53 static const std::string kNotificationId = | 53 const char kNotificationId[] = "chrome://settings/sync/testuser@test.com"; |
| 54 "chrome://settings/sync/testuser@test.com"; | |
| 55 | 54 |
| 56 class FakeLoginUIService: public LoginUIService { | 55 class FakeLoginUIService: public LoginUIService { |
| 57 public: | 56 public: |
| 58 FakeLoginUIService() : LoginUIService(NULL) {} | 57 FakeLoginUIService() : LoginUIService(NULL) {} |
| 59 ~FakeLoginUIService() override {} | 58 ~FakeLoginUIService() override {} |
| 60 }; | 59 }; |
| 61 | 60 |
| 62 class FakeLoginUI : public LoginUIService::LoginUI { | 61 class FakeLoginUI : public LoginUIService::LoginUI { |
| 63 public: | 62 public: |
| 64 FakeLoginUI() : focus_ui_call_count_(0) {} | 63 FakeLoginUI() : focus_ui_call_count_(0) {} |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 error_notifier_->Shutdown(); | 120 error_notifier_->Shutdown(); |
| 122 service_.reset(); | 121 service_.reset(); |
| 123 profile_manager_.reset(); | 122 profile_manager_.reset(); |
| 124 | 123 |
| 125 AshTestBase::TearDown(); | 124 AshTestBase::TearDown(); |
| 126 | 125 |
| 127 #if defined(OS_WIN) | 126 #if defined(OS_WIN) |
| 128 display::Screen::SetScreenInstance(nullptr); | 127 display::Screen::SetScreenInstance(nullptr); |
| 129 test_screen_.reset(); | 128 test_screen_.reset(); |
| 130 #endif | 129 #endif |
| 131 | |
| 132 } | 130 } |
| 133 | 131 |
| 134 protected: | 132 protected: |
| 135 // Utility function to test that SyncErrorNotifier behaves correctly for the | 133 // Utility function to test that SyncErrorNotifier behaves correctly for the |
| 136 // given error condition. | 134 // given error condition. |
| 137 void VerifySyncErrorNotifierResult(GoogleServiceAuthError::State error_state, | 135 void VerifySyncErrorNotifierResult(GoogleServiceAuthError::State error_state, |
| 138 bool is_signed_in, | 136 bool is_signed_in, |
| 139 bool is_error) { | 137 bool is_error) { |
| 140 EXPECT_CALL(*service_, IsFirstSetupComplete()) | 138 EXPECT_CALL(*service_, IsFirstSetupComplete()) |
| 141 .WillRepeatedly(Return(is_signed_in)); | 139 .WillRepeatedly(Return(is_signed_in)); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 SCOPED_TRACE("Not expecting notification since sync setup is incomplete"); | 227 SCOPED_TRACE("Not expecting notification since sync setup is incomplete"); |
| 230 VerifySyncErrorNotifierResult( | 228 VerifySyncErrorNotifierResult( |
| 231 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS, | 229 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS, |
| 232 false /* not signed in */, | 230 false /* not signed in */, |
| 233 false /* no error */); | 231 false /* no error */); |
| 234 } | 232 } |
| 235 } | 233 } |
| 236 | 234 |
| 237 } // namespace test | 235 } // namespace test |
| 238 } // namespace ash | 236 } // namespace ash |
| OLD | NEW |