Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Side by Side Diff: chrome/browser/sync/test/integration/passwords_helper.h

Issue 2379433002: [Sync] Refactoring of sync integration test checkers to remove boilerplate await methods. (Closed)
Patch Set: Rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_PASSWORDS_HELPER_H_ 5 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_PASSWORDS_HELPER_H_
6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_PASSWORDS_HELPER_H_ 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_PASSWORDS_HELPER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string>
9 #include <vector> 10 #include <vector>
10 11
11 #include "base/memory/scoped_vector.h" 12 #include "base/memory/scoped_vector.h"
12 #include "chrome/browser/profiles/profile.h" 13 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/browser/sync/test/integration/multi_client_status_change_checke r.h"
15 #include "chrome/browser/sync/test/integration/single_client_status_change_check er.h"
13 #include "chrome/browser/sync/test/integration/sync_test.h" 16 #include "chrome/browser/sync/test/integration/sync_test.h"
14 #include "components/autofill/core/common/password_form.h" 17 #include "components/autofill/core/common/password_form.h"
15 #include "components/browser_sync/profile_sync_service.h" 18 #include "components/browser_sync/profile_sync_service.h"
16 19
17 namespace password_manager { 20 namespace password_manager {
18 class PasswordStore; 21 class PasswordStore;
19 } 22 }
20 23
21 namespace passwords_helper { 24 namespace passwords_helper {
22 25
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 // password forms as the profile with index |index_b|. 61 // password forms as the profile with index |index_b|.
59 bool ProfilesContainSamePasswordForms(int index_a, int index_b); 62 bool ProfilesContainSamePasswordForms(int index_a, int index_b);
60 63
61 // Returns true iff all profiles contain the same password forms as the 64 // Returns true iff all profiles contain the same password forms as the
62 // verifier profile. 65 // verifier profile.
63 bool AllProfilesContainSamePasswordFormsAsVerifier(); 66 bool AllProfilesContainSamePasswordFormsAsVerifier();
64 67
65 // Returns true iff all profiles contain the same password forms. 68 // Returns true iff all profiles contain the same password forms.
66 bool AllProfilesContainSamePasswordForms(); 69 bool AllProfilesContainSamePasswordForms();
67 70
68 // Returns true if all profiles contain the same password forms and
69 // it doesn't time out.
70 bool AwaitAllProfilesContainSamePasswordForms();
71
72 // Returns true if specified profile contains the same password forms as the
73 // verifier and it doesn't time out.
74 bool AwaitProfileContainsSamePasswordFormsAsVerifier(int index); 71 bool AwaitProfileContainsSamePasswordFormsAsVerifier(int index);
75 72
76 // Returns the number of forms in the password store of the profile with index 73 // Returns the number of forms in the password store of the profile with index
77 // |index|. 74 // |index|.
78 int GetPasswordCount(int index); 75 int GetPasswordCount(int index);
79 76
80 // Returns the number of forms in the password store of the verifier profile. 77 // Returns the number of forms in the password store of the verifier profile.
81 int GetVerifierPasswordCount(); 78 int GetVerifierPasswordCount();
82 79
83 // Creates a test password form with a well known fake signon realm used only 80 // Creates a test password form with a well known fake signon realm used only
84 // by PasswordsSyncPerfTest based on |index|. 81 // by PasswordsSyncPerfTest based on |index|.
85 autofill::PasswordForm CreateTestPasswordForm(int index); 82 autofill::PasswordForm CreateTestPasswordForm(int index);
86 83
87 } // namespace passwords_helper 84 } // namespace passwords_helper
88 85
86 // Checker to block until all profiles contain the same password forms.
87 class SamePasswordFormsChecker : public MultiClientStatusChangeChecker {
88 public:
89 SamePasswordFormsChecker();
90
91 // StatusChangeChecker implementation.
92 bool IsExitConditionSatisfied() override;
93 std::string GetDebugMessage() const override;
94
95 private:
96 bool in_progress_;
97 bool needs_recheck_;
98 };
99
100 // Checker to block until specified profile contains the same password forms as
101 // the verifier.
102 class SamePasswordFormsAsVerifierChecker
103 : public SingleClientStatusChangeChecker {
104 public:
105 explicit SamePasswordFormsAsVerifierChecker(int index);
106
107 // StatusChangeChecker implementation.
108 bool IsExitConditionSatisfied() override;
109 std::string GetDebugMessage() const override;
110
111 private:
112 int index_;
113 bool in_progress_;
114 bool needs_recheck_;
115 };
116
89 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_PASSWORDS_HELPER_H_ 117 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_PASSWORDS_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698