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

Side by Side Diff: chrome/browser/sync/test/integration/sync_integration_test_util.cc

Issue 2354613002: [Sync] Fix namespaces for the browser_sync component. (Closed)
Patch Set: Address comments. Created 4 years, 3 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 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/test/integration/sync_integration_test_util.h" 5 #include "chrome/browser/sync/test/integration/sync_integration_test_util.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "chrome/browser/sync/test/integration/fake_server_match_status_checker. h" 10 #include "chrome/browser/sync/test/integration/fake_server_match_status_checker. h"
(...skipping 23 matching lines...) Expand all
34 type_); 34 type_);
35 } 35 }
36 36
37 private: 37 private:
38 const syncer::ModelType type_; 38 const syncer::ModelType type_;
39 const size_t count_; 39 const size_t count_;
40 }; 40 };
41 41
42 class PassphraseRequiredChecker : public SingleClientStatusChangeChecker { 42 class PassphraseRequiredChecker : public SingleClientStatusChangeChecker {
43 public: 43 public:
44 explicit PassphraseRequiredChecker(ProfileSyncService* service) 44 explicit PassphraseRequiredChecker(browser_sync::ProfileSyncService* service)
45 : SingleClientStatusChangeChecker(service) {} 45 : SingleClientStatusChangeChecker(service) {}
46 46
47 bool IsExitConditionSatisfied() override { 47 bool IsExitConditionSatisfied() override {
48 return service()->IsPassphraseRequired(); 48 return service()->IsPassphraseRequired();
49 } 49 }
50 50
51 std::string GetDebugMessage() const override { return "Passhrase Required"; } 51 std::string GetDebugMessage() const override { return "Passhrase Required"; }
52 }; 52 };
53 53
54 class PassphraseAcceptedChecker : public SingleClientStatusChangeChecker { 54 class PassphraseAcceptedChecker : public SingleClientStatusChangeChecker {
55 public: 55 public:
56 explicit PassphraseAcceptedChecker(ProfileSyncService* service) 56 explicit PassphraseAcceptedChecker(browser_sync::ProfileSyncService* service)
57 : SingleClientStatusChangeChecker(service) {} 57 : SingleClientStatusChangeChecker(service) {}
58 58
59 bool IsExitConditionSatisfied() override { 59 bool IsExitConditionSatisfied() override {
60 return !service()->IsPassphraseRequired() && 60 return !service()->IsPassphraseRequired() &&
61 service()->IsUsingSecondaryPassphrase(); 61 service()->IsUsingSecondaryPassphrase();
62 } 62 }
63 63
64 std::string GetDebugMessage() const override { return "Passhrase Accepted"; } 64 std::string GetDebugMessage() const override { return "Passhrase Accepted"; }
65 }; 65 };
66 66
67 } // namespace 67 } // namespace
68 68
69 namespace sync_integration_test_util { 69 namespace sync_integration_test_util {
70 70
71 bool AwaitPassphraseRequired(ProfileSyncService* service) { 71 bool AwaitPassphraseRequired(browser_sync::ProfileSyncService* service) {
72 PassphraseRequiredChecker checker(service); 72 PassphraseRequiredChecker checker(service);
73 checker.Wait(); 73 checker.Wait();
74 return !checker.TimedOut(); 74 return !checker.TimedOut();
75 } 75 }
76 76
77 bool AwaitPassphraseAccepted(ProfileSyncService* service) { 77 bool AwaitPassphraseAccepted(browser_sync::ProfileSyncService* service) {
78 PassphraseAcceptedChecker checker(service); 78 PassphraseAcceptedChecker checker(service);
79 checker.Wait(); 79 checker.Wait();
80 return !checker.TimedOut(); 80 return !checker.TimedOut();
81 } 81 }
82 82
83 bool AwaitCommitActivityCompletion(ProfileSyncService* service) { 83 bool AwaitCommitActivityCompletion(browser_sync::ProfileSyncService* service) {
84 UpdatedProgressMarkerChecker checker(service); 84 UpdatedProgressMarkerChecker checker(service);
85 checker.Wait(); 85 checker.Wait();
86 return !checker.TimedOut(); 86 return !checker.TimedOut();
87 } 87 }
88 88
89 bool AwaitServerCount(syncer::ModelType type, size_t count) { 89 bool AwaitServerCount(syncer::ModelType type, size_t count) {
90 ServerCountMatchStatusChecker checker(type, count); 90 ServerCountMatchStatusChecker checker(type, count);
91 checker.Wait(); 91 checker.Wait();
92 return !checker.TimedOut(); 92 return !checker.TimedOut();
93 } 93 }
94 94
95 } // namespace sync_integration_test_util 95 } // namespace sync_integration_test_util
OLDNEW
« no previous file with comments | « chrome/browser/sync/test/integration/sync_integration_test_util.h ('k') | chrome/browser/sync/test/integration/sync_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698