| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/password_manager/sync/browser/password_sync_util.h" | 5 #include "components/password_manager/sync/browser/password_sync_util.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "components/autofill/core/common/password_form.h" | 10 #include "components/autofill/core/common/password_form.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 const struct { | 59 const struct { |
| 60 PasswordForm form; | 60 PasswordForm form; |
| 61 std::string fake_sync_username; | 61 std::string fake_sync_username; |
| 62 bool expected_result; | 62 bool expected_result; |
| 63 } kTestCases[] = { | 63 } kTestCases[] = { |
| 64 {SimpleGaiaForm("sync_user@example.org"), "sync_user@example.org", true}, | 64 {SimpleGaiaForm("sync_user@example.org"), "sync_user@example.org", true}, |
| 65 {SimpleGaiaForm("non_sync_user@example.org"), "sync_user@example.org", | 65 {SimpleGaiaForm("non_sync_user@example.org"), "sync_user@example.org", |
| 66 false}, | 66 false}, |
| 67 {SimpleNonGaiaForm("sync_user@example.org"), "sync_user@example.org", | 67 {SimpleNonGaiaForm("sync_user@example.org"), "sync_user@example.org", |
| 68 false}, | 68 false}, |
| 69 {SimpleGaiaForm(""), "sync_user@example.org", true}, |
| 70 {SimpleNonGaiaForm(""), "sync_user@example.org", false}, |
| 69 }; | 71 }; |
| 70 | 72 |
| 71 for (size_t i = 0; i < arraysize(kTestCases); ++i) { | 73 for (size_t i = 0; i < arraysize(kTestCases); ++i) { |
| 72 SCOPED_TRACE(testing::Message() << "i=" << i); | 74 SCOPED_TRACE(testing::Message() << "i=" << i); |
| 73 SetSyncingPasswords(true); | 75 SetSyncingPasswords(true); |
| 74 FakeSigninAs(kTestCases[i].fake_sync_username); | 76 FakeSigninAs(kTestCases[i].fake_sync_username); |
| 75 EXPECT_EQ(kTestCases[i].expected_result, | 77 EXPECT_EQ(kTestCases[i].expected_result, |
| 76 IsSyncAccountCredential(kTestCases[i].form, sync_service(), | 78 IsSyncAccountCredential(kTestCases[i].form, sync_service(), |
| 77 signin_manager())); | 79 signin_manager())); |
| 78 } | 80 } |
| 79 } | 81 } |
| 80 | 82 |
| 81 } // namespace sync_util | 83 } // namespace sync_util |
| 82 } // namespace password_manager | 84 } // namespace password_manager |
| OLD | NEW |