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