| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 "base/macros.h" | 5 #include "base/macros.h" |
| 6 #include "chrome/browser/sync/test/integration/await_match_status_change_checker
.h" | 6 #include "chrome/browser/sync/test/integration/await_match_status_change_checker
.h" |
| 7 #include "chrome/browser/sync/test/integration/extensions_helper.h" | 7 #include "chrome/browser/sync/test/integration/extensions_helper.h" |
| 8 #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" | 8 #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" |
| 9 #include "chrome/browser/sync/test/integration/sync_test.h" | 9 #include "chrome/browser/sync/test/integration/sync_test.h" |
| 10 #include "components/browser_sync/profile_sync_service.h" | 10 #include "components/browser_sync/profile_sync_service.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 IN_PROC_BROWSER_TEST_F(SingleClientExtensionsSyncTest, InstallSomeExtensions) { | 51 IN_PROC_BROWSER_TEST_F(SingleClientExtensionsSyncTest, InstallSomeExtensions) { |
| 52 ASSERT_TRUE(SetupSync()); | 52 ASSERT_TRUE(SetupSync()); |
| 53 | 53 |
| 54 const int kNumExtensions = 5; | 54 const int kNumExtensions = 5; |
| 55 for (int i = 0; i < kNumExtensions; ++i) { | 55 for (int i = 0; i < kNumExtensions; ++i) { |
| 56 InstallExtension(GetProfile(0), i); | 56 InstallExtension(GetProfile(0), i); |
| 57 InstallExtension(verifier(), i); | 57 InstallExtension(verifier(), i); |
| 58 } | 58 } |
| 59 | 59 |
| 60 ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0)))); | 60 ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService(0))); |
| 61 | 61 |
| 62 ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier()); | 62 ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier()); |
| 63 } | 63 } |
| 64 | 64 |
| 65 // Helper function for waiting to see the extension count in a profile | 65 // Helper function for waiting to see the extension count in a profile |
| 66 // become a specific number. | 66 // become a specific number. |
| 67 static bool ExtensionCountCheck(Profile* profile, size_t expected_count) { | 67 static bool ExtensionCountCheck(Profile* profile, size_t expected_count) { |
| 68 return GetInstalledExtensions(profile).size() == expected_count; | 68 return GetInstalledExtensions(profile).size() == expected_count; |
| 69 } | 69 } |
| 70 | 70 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 100 GetFakeServer()->GetSyncEntitiesByModelType(syncer::EXTENSIONS); | 100 GetFakeServer()->GetSyncEntitiesByModelType(syncer::EXTENSIONS); |
| 101 EXPECT_EQ(0ul, server_extensions.size()); | 101 EXPECT_EQ(0ul, server_extensions.size()); |
| 102 | 102 |
| 103 AwaitMatchStatusChangeChecker checker( | 103 AwaitMatchStatusChangeChecker checker( |
| 104 base::Bind(&ExtensionCountCheck, GetProfile(0), 0u), | 104 base::Bind(&ExtensionCountCheck, GetProfile(0), 0u), |
| 105 "Waiting for profile to have no extensions"); | 105 "Waiting for profile to have no extensions"); |
| 106 checker.Wait(); | 106 checker.Wait(); |
| 107 EXPECT_TRUE(!checker.TimedOut()); | 107 EXPECT_TRUE(!checker.TimedOut()); |
| 108 EXPECT_TRUE(GetInstalledExtensions(GetProfile(0)).empty()); | 108 EXPECT_TRUE(GetInstalledExtensions(GetProfile(0)).empty()); |
| 109 } | 109 } |
| OLD | NEW |