| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/os_crypt/key_storage_kwallet.h" | 5 #include "components/os_crypt/key_storage_kwallet.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/nix/xdg_util.h" | 8 #include "base/nix/xdg_util.h" |
| 9 #include "dbus/message.h" | 9 #include "dbus/message.h" |
| 10 #include "dbus/mock_bus.h" | 10 #include "dbus/mock_bus.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 using testing::SetArgPointee; | 23 using testing::SetArgPointee; |
| 24 using testing::StrictMock; | 24 using testing::StrictMock; |
| 25 | 25 |
| 26 constexpr KWalletDBus::Error SUCCESS = KWalletDBus::Error::SUCCESS; | 26 constexpr KWalletDBus::Error SUCCESS = KWalletDBus::Error::SUCCESS; |
| 27 constexpr KWalletDBus::Error CANNOT_READ = KWalletDBus::Error::CANNOT_READ; | 27 constexpr KWalletDBus::Error CANNOT_READ = KWalletDBus::Error::CANNOT_READ; |
| 28 constexpr KWalletDBus::Error CANNOT_CONTACT = | 28 constexpr KWalletDBus::Error CANNOT_CONTACT = |
| 29 KWalletDBus::Error::CANNOT_CONTACT; | 29 KWalletDBus::Error::CANNOT_CONTACT; |
| 30 | 30 |
| 31 // These names are not allowed to change in prod, unless we intentionally | 31 // These names are not allowed to change in prod, unless we intentionally |
| 32 // migrate. | 32 // migrate. |
| 33 #if defined(OFFICIAL_BUILD) | 33 #if defined(GOOGLE_CHROME_BUILD) |
| 34 const char kExpectedFolderName[] = "Chrome Keys"; | 34 const char kExpectedFolderName[] = "Chrome Keys"; |
| 35 const char kExpectedEntryName[] = "Chrome Safe Storage"; | 35 const char kExpectedEntryName[] = "Chrome Safe Storage"; |
| 36 #else | 36 #else |
| 37 const char kExpectedFolderName[] = "Chromium Keys"; | 37 const char kExpectedFolderName[] = "Chromium Keys"; |
| 38 const char kExpectedEntryName[] = "Chromium Safe Storage"; | 38 const char kExpectedEntryName[] = "Chromium Safe Storage"; |
| 39 #endif | 39 #endif |
| 40 | 40 |
| 41 // Environment-specific behavior is handled and tested with KWalletDBus, not | 41 // Environment-specific behavior is handled and tested with KWalletDBus, not |
| 42 // here, but we still need a value to instantiate. | 42 // here, but we still need a value to instantiate. |
| 43 const base::nix::DesktopEnvironment kDesktopEnv = | 43 const base::nix::DesktopEnvironment kDesktopEnv = |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 .WillOnce(DoAll(SetArgPointee<3>(true), Return(SUCCESS))); | 310 .WillOnce(DoAll(SetArgPointee<3>(true), Return(SUCCESS))); |
| 311 EXPECT_CALL(*kwallet_dbus_mock_, ReadPassword(123, _, _, _, _)) | 311 EXPECT_CALL(*kwallet_dbus_mock_, ReadPassword(123, _, _, _, _)) |
| 312 .WillOnce(DoAll(SetArgPointee<4>(""), Return(SUCCESS))); | 312 .WillOnce(DoAll(SetArgPointee<4>(""), Return(SUCCESS))); |
| 313 EXPECT_CALL(*kwallet_dbus_mock_, WritePassword(123, _, _, _, _, _)) | 313 EXPECT_CALL(*kwallet_dbus_mock_, WritePassword(123, _, _, _, _, _)) |
| 314 .WillOnce(Return(GetParam())); | 314 .WillOnce(Return(GetParam())); |
| 315 | 315 |
| 316 EXPECT_EQ("", key_storage_kwallet_.GetKey()); | 316 EXPECT_EQ("", key_storage_kwallet_.GetKey()); |
| 317 } | 317 } |
| 318 | 318 |
| 319 } // namespace | 319 } // namespace |
| OLD | NEW |