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