| 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 16 matching lines...) Expand all Loading... |
| 27 #include "testing/gmock/include/gmock/gmock.h" | 27 #include "testing/gmock/include/gmock/gmock.h" |
| 28 #include "testing/gtest/include/gtest/gtest.h" | 28 #include "testing/gtest/include/gtest/gtest.h" |
| 29 #include "ui/message_center/notification.h" | 29 #include "ui/message_center/notification.h" |
| 30 | 30 |
| 31 #if defined(OS_WIN) | 31 #if defined(OS_WIN) |
| 32 #include "chrome/browser/ui/ash/ash_util.h" | 32 #include "chrome/browser/ui/ash/ash_util.h" |
| 33 #include "ui/aura/test/test_screen.h" | 33 #include "ui/aura/test/test_screen.h" |
| 34 #include "ui/display/screen.h" | 34 #include "ui/display/screen.h" |
| 35 #endif | 35 #endif |
| 36 | 36 |
| 37 #if defined(OS_CHROMEOS) | |
| 38 #include "chrome/browser/chromeos/login/users/mock_user_manager.h" | |
| 39 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" | |
| 40 #endif | |
| 41 | |
| 42 using ::testing::NiceMock; | 37 using ::testing::NiceMock; |
| 43 using ::testing::Return; | 38 using ::testing::Return; |
| 44 using ::testing::ReturnRef; | 39 using ::testing::ReturnRef; |
| 45 using ::testing::_; | 40 using ::testing::_; |
| 46 | 41 |
| 47 namespace ash { | 42 namespace ash { |
| 48 namespace test { | 43 namespace test { |
| 49 | 44 |
| 50 namespace { | 45 namespace { |
| 51 | 46 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 | 177 |
| 183 // Test that SyncErrorNotifier shows an notification if a passphrase is | 178 // Test that SyncErrorNotifier shows an notification if a passphrase is |
| 184 // required. | 179 // required. |
| 185 // Disabled on Windows: http://crbug.com/373238 | 180 // Disabled on Windows: http://crbug.com/373238 |
| 186 #if defined(OS_WIN) | 181 #if defined(OS_WIN) |
| 187 #define MAYBE_PassphraseNotification DISABLED_PassphraseNotification | 182 #define MAYBE_PassphraseNotification DISABLED_PassphraseNotification |
| 188 #else | 183 #else |
| 189 #define MAYBE_PassphraseNotification PassphraseNotification | 184 #define MAYBE_PassphraseNotification PassphraseNotification |
| 190 #endif | 185 #endif |
| 191 TEST_F(SyncErrorNotifierTest, MAYBE_PassphraseNotification) { | 186 TEST_F(SyncErrorNotifierTest, MAYBE_PassphraseNotification) { |
| 192 #if defined(OS_CHROMEOS) | |
| 193 chromeos::ScopedUserManagerEnabler scoped_enabler( | |
| 194 new chromeos::MockUserManager()); | |
| 195 #endif | |
| 196 ASSERT_FALSE(notification_ui_manager_->FindById( | 187 ASSERT_FALSE(notification_ui_manager_->FindById( |
| 197 kNotificationId, NotificationUIManager::GetProfileID(profile_))); | 188 kNotificationId, NotificationUIManager::GetProfileID(profile_))); |
| 198 | 189 |
| 199 browser_sync::SyncBackendHost::Status status; | 190 browser_sync::SyncBackendHost::Status status; |
| 200 EXPECT_CALL(*service_, QueryDetailedSyncStatus(_)) | 191 EXPECT_CALL(*service_, QueryDetailedSyncStatus(_)) |
| 201 .WillRepeatedly(Return(false)); | 192 .WillRepeatedly(Return(false)); |
| 202 | 193 |
| 203 EXPECT_CALL(*service_, IsPassphraseRequired()) | 194 EXPECT_CALL(*service_, IsPassphraseRequired()) |
| 204 .WillRepeatedly(Return(true)); | 195 .WillRepeatedly(Return(true)); |
| 205 EXPECT_CALL(*service_, IsPassphraseRequiredForDecryption()) | 196 EXPECT_CALL(*service_, IsPassphraseRequiredForDecryption()) |
| (...skipping 26 matching lines...) Expand all Loading... |
| 232 SCOPED_TRACE("Not expecting notification since sync setup is incomplete"); | 223 SCOPED_TRACE("Not expecting notification since sync setup is incomplete"); |
| 233 VerifySyncErrorNotifierResult( | 224 VerifySyncErrorNotifierResult( |
| 234 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS, | 225 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS, |
| 235 false /* not signed in */, | 226 false /* not signed in */, |
| 236 false /* no error */); | 227 false /* no error */); |
| 237 } | 228 } |
| 238 } | 229 } |
| 239 | 230 |
| 240 } // namespace test | 231 } // namespace test |
| 241 } // namespace ash | 232 } // namespace ash |
| OLD | NEW |