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/profile_sync_service.h"
7 #include "chrome/browser/sync/test/integration/extensions_helper.h"
8 #include "chrome/browser/sync/test/integration/sync_integration_test_util.h"
9 #include "chrome/browser/sync/test/integration/sync_test.h"
11 using extensions_helper::AllProfilesHaveSameExtensionsAsVerifier
;
12 using extensions_helper::InstallExtension
;
13 using sync_integration_test_util::AwaitCommitActivityCompletion
;
15 class SingleClientExtensionsSyncTest
: public SyncTest
{
17 SingleClientExtensionsSyncTest() : SyncTest(SINGLE_CLIENT
) {}
19 ~SingleClientExtensionsSyncTest() override
{}
22 DISALLOW_COPY_AND_ASSIGN(SingleClientExtensionsSyncTest
);
25 IN_PROC_BROWSER_TEST_F(SingleClientExtensionsSyncTest
, StartWithNoExtensions
) {
26 ASSERT_TRUE(SetupSync());
28 ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier());
31 IN_PROC_BROWSER_TEST_F(SingleClientExtensionsSyncTest
,
32 StartWithSomeExtensions
) {
33 ASSERT_TRUE(SetupClients());
35 const int kNumExtensions
= 5;
36 for (int i
= 0; i
< kNumExtensions
; ++i
) {
37 InstallExtension(GetProfile(0), i
);
38 InstallExtension(verifier(), i
);
41 ASSERT_TRUE(SetupSync());
43 ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier());
46 IN_PROC_BROWSER_TEST_F(SingleClientExtensionsSyncTest
, InstallSomeExtensions
) {
47 ASSERT_TRUE(SetupSync());
49 const int kNumExtensions
= 5;
50 for (int i
= 0; i
< kNumExtensions
; ++i
) {
51 InstallExtension(GetProfile(0), i
);
52 InstallExtension(verifier(), i
);
55 ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0))));
57 ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier());