Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / sync / test / integration / single_client_extensions_sync_test.cc
blobf89004002313629de74d6c8d844c8af9c8d9dff3
1 // Copyright (c) 2011 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 "base/basictypes.h"
6 #include "chrome/browser/sync/test/integration/extensions_helper.h"
7 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h"
8 #include "chrome/browser/sync/test/integration/sync_test.h"
10 using extensions_helper::AllProfilesHaveSameExtensionsAsVerifier;
11 using extensions_helper::InstallExtension;
13 class SingleClientExtensionsSyncTest : public SyncTest {
14 public:
15 SingleClientExtensionsSyncTest() : SyncTest(SINGLE_CLIENT) {}
17 virtual ~SingleClientExtensionsSyncTest() {}
19 private:
20 DISALLOW_COPY_AND_ASSIGN(SingleClientExtensionsSyncTest);
23 IN_PROC_BROWSER_TEST_F(SingleClientExtensionsSyncTest, StartWithNoExtensions) {
24 ASSERT_TRUE(SetupSync());
26 ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier());
29 IN_PROC_BROWSER_TEST_F(SingleClientExtensionsSyncTest,
30 StartWithSomeExtensions) {
31 ASSERT_TRUE(SetupClients());
33 const int kNumExtensions = 5;
34 for (int i = 0; i < kNumExtensions; ++i) {
35 InstallExtension(GetProfile(0), i);
36 InstallExtension(verifier(), i);
39 ASSERT_TRUE(SetupSync());
41 ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier());
44 IN_PROC_BROWSER_TEST_F(SingleClientExtensionsSyncTest, InstallSomeExtensions) {
45 ASSERT_TRUE(SetupSync());
47 const int kNumExtensions = 5;
48 for (int i = 0; i < kNumExtensions; ++i) {
49 InstallExtension(GetProfile(0), i);
50 InstallExtension(verifier(), i);
53 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion());
55 ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier());