Add new certificateProvider extension API.
[chromium-blink-merge.git] / chrome / browser / sync / test / integration / sync_integration_test_util.cc
blob248d051cc4d4e6ab1087f28b3d3fc5bf5e6664a2
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
3 // found in the LICENSE file.
5 #include "chrome/browser/sync/test/integration/sync_integration_test_util.h"
7 #include "chrome/browser/sync/profile_sync_service.h"
8 #include "chrome/browser/sync/test/integration/single_client_status_change_checker.h"
9 #include "chrome/browser/sync/test/integration/updated_progress_marker_checker.h"
11 namespace sync_integration_test_util {
13 class PassphraseRequiredChecker : public SingleClientStatusChangeChecker {
14 public:
15 explicit PassphraseRequiredChecker(ProfileSyncService* service)
16 : SingleClientStatusChangeChecker(service) {}
18 bool IsExitConditionSatisfied() override {
19 return service()->IsPassphraseRequired();
22 std::string GetDebugMessage() const override { return "Passhrase Required"; }
25 class PassphraseAcceptedChecker : public SingleClientStatusChangeChecker {
26 public:
27 explicit PassphraseAcceptedChecker(ProfileSyncService* service)
28 : SingleClientStatusChangeChecker(service) {}
30 bool IsExitConditionSatisfied() override {
31 return !service()->IsPassphraseRequired() &&
32 service()->IsUsingSecondaryPassphrase();
35 std::string GetDebugMessage() const override { return "Passhrase Accepted"; }
38 bool AwaitPassphraseRequired(ProfileSyncService* service) {
39 PassphraseRequiredChecker checker(service);
40 checker.Wait();
41 return !checker.TimedOut();
44 bool AwaitPassphraseAccepted(ProfileSyncService* service) {
45 PassphraseAcceptedChecker checker(service);
46 checker.Wait();
47 return !checker.TimedOut();
50 bool AwaitCommitActivityCompletion(ProfileSyncService* service) {
51 UpdatedProgressMarkerChecker checker(service);
52 checker.Wait();
53 return !checker.TimedOut();
56 } // namespace sync_integration_test_util