summaryrefslogtreecommitdiffstats
path: root/chrome/test/live_sync/live_preferences_sync_test.h
blob: 9e2e041f11133034fc8067ebd878bbf634d037f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_TEST_LIVE_SYNC_LIVE_PREFERENCES_SYNC_TEST_H_
#define CHROME_TEST_LIVE_SYNC_LIVE_PREFERENCES_SYNC_TEST_H_
#pragma once

#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/test/live_sync/live_sync_test.h"

class LivePreferencesSyncTest : public LiveSyncTest {
 public:
  explicit LivePreferencesSyncTest(TestType test_type)
      : LiveSyncTest(test_type) {}
  virtual ~LivePreferencesSyncTest() {}

  // Used to access the preferences within a particular sync profile.
  PrefService* GetPrefs(int index) {
    return GetProfile(index)->GetPrefs();
  }

  // Used to access the preferences within the verifier sync profile.
  PrefService* GetVerifierPrefs() {
    return verifier()->GetPrefs();
  }

 private:
  DISALLOW_COPY_AND_ASSIGN(LivePreferencesSyncTest);
};

class SingleClientLivePreferencesSyncTest : public LivePreferencesSyncTest {
 public:
  SingleClientLivePreferencesSyncTest()
      : LivePreferencesSyncTest(SINGLE_CLIENT) {}
  virtual ~SingleClientLivePreferencesSyncTest() {}

 private:
  DISALLOW_COPY_AND_ASSIGN(SingleClientLivePreferencesSyncTest);
};

class TwoClientLivePreferencesSyncTest : public LivePreferencesSyncTest {
 public:
  TwoClientLivePreferencesSyncTest() : LivePreferencesSyncTest(TWO_CLIENT) {}
  virtual ~TwoClientLivePreferencesSyncTest() {}

 private:
  DISALLOW_COPY_AND_ASSIGN(TwoClientLivePreferencesSyncTest);
};

class MultipleClientLivePreferencesSyncTest : public LivePreferencesSyncTest {
 public:
  MultipleClientLivePreferencesSyncTest()
      : LivePreferencesSyncTest(MULTIPLE_CLIENT) {}
  virtual ~MultipleClientLivePreferencesSyncTest() {}

 private:
  DISALLOW_COPY_AND_ASSIGN(MultipleClientLivePreferencesSyncTest);
};

class ManyClientLivePreferencesSyncTest : public LivePreferencesSyncTest {
 public:
  ManyClientLivePreferencesSyncTest() : LivePreferencesSyncTest(MANY_CLIENT) {}
  virtual ~ManyClientLivePreferencesSyncTest() {}

 private:
  DISALLOW_COPY_AND_ASSIGN(ManyClientLivePreferencesSyncTest);
};

#endif  // CHROME_TEST_LIVE_SYNC_LIVE_PREFERENCES_SYNC_TEST_H_