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/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "chrome/browser/sync/profile_sync_service_harness.h" | 6 #include "chrome/browser/sync/profile_sync_service_harness.h" |
7 #include "chrome/browser/sync/test/integration/apps_helper.h" | 7 #include "chrome/browser/sync/test/integration/apps_helper.h" |
8 #include "chrome/browser/sync/test/integration/sync_test.h" | 8 #include "chrome/browser/sync/test/integration/sync_test.h" |
9 | 9 |
10 using apps_helper::AllProfilesHaveSameAppsAsVerifier; | 10 using apps_helper::AllProfilesHaveSameAppsAsVerifier; |
11 using apps_helper::InstallApp; | 11 using apps_helper::InstallApp; |
12 using apps_helper::InstallPlatformApp; | 12 using apps_helper::InstallPlatformApp; |
| 13 using apps_helper::WaitForPlatformAppsToUnload; |
13 | 14 |
14 class SingleClientAppsSyncTest : public SyncTest { | 15 class SingleClientAppsSyncTest : public SyncTest { |
15 public: | 16 public: |
16 SingleClientAppsSyncTest() : SyncTest(SINGLE_CLIENT) {} | 17 SingleClientAppsSyncTest() : SyncTest(SINGLE_CLIENT) {} |
17 | 18 |
18 virtual ~SingleClientAppsSyncTest() {} | 19 virtual ~SingleClientAppsSyncTest() {} |
19 | 20 |
20 private: | 21 private: |
21 DISALLOW_COPY_AND_ASSIGN(SingleClientAppsSyncTest); | 22 DISALLOW_COPY_AND_ASSIGN(SingleClientAppsSyncTest); |
22 }; | 23 }; |
(...skipping 23 matching lines...) Expand all Loading... |
46 | 47 |
47 const int kNumApps = 5; | 48 const int kNumApps = 5; |
48 for (int i = 0; i < kNumApps; ++i) { | 49 for (int i = 0; i < kNumApps; ++i) { |
49 InstallPlatformApp(GetProfile(0), i); | 50 InstallPlatformApp(GetProfile(0), i); |
50 InstallPlatformApp(verifier(), i); | 51 InstallPlatformApp(verifier(), i); |
51 } | 52 } |
52 | 53 |
53 ASSERT_TRUE(SetupSync()); | 54 ASSERT_TRUE(SetupSync()); |
54 | 55 |
55 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); | 56 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
| 57 |
| 58 WaitForPlatformAppsToUnload(); |
56 } | 59 } |
57 | 60 |
58 IN_PROC_BROWSER_TEST_F(SingleClientAppsSyncTest, InstallSomeLegacyApps) { | 61 IN_PROC_BROWSER_TEST_F(SingleClientAppsSyncTest, InstallSomeLegacyApps) { |
59 ASSERT_TRUE(SetupSync()); | 62 ASSERT_TRUE(SetupSync()); |
60 | 63 |
61 const int kNumApps = 5; | 64 const int kNumApps = 5; |
62 for (int i = 0; i < kNumApps; ++i) { | 65 for (int i = 0; i < kNumApps; ++i) { |
63 InstallApp(GetProfile(0), i); | 66 InstallApp(GetProfile(0), i); |
64 InstallApp(verifier(), i); | 67 InstallApp(verifier(), i); |
65 } | 68 } |
(...skipping 10 matching lines...) Expand all Loading... |
76 const int kNumApps = 5; | 79 const int kNumApps = 5; |
77 for (int i = 0; i < kNumApps; ++i) { | 80 for (int i = 0; i < kNumApps; ++i) { |
78 InstallPlatformApp(GetProfile(0), i); | 81 InstallPlatformApp(GetProfile(0), i); |
79 InstallPlatformApp(verifier(), i); | 82 InstallPlatformApp(verifier(), i); |
80 } | 83 } |
81 | 84 |
82 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion( | 85 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion( |
83 "Waiting for app changes.")); | 86 "Waiting for app changes.")); |
84 | 87 |
85 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); | 88 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
| 89 |
| 90 WaitForPlatformAppsToUnload(); |
86 } | 91 } |
87 | 92 |
88 IN_PROC_BROWSER_TEST_F(SingleClientAppsSyncTest, InstallSomeApps) { | 93 IN_PROC_BROWSER_TEST_F(SingleClientAppsSyncTest, InstallSomeApps) { |
89 ASSERT_TRUE(SetupSync()); | 94 ASSERT_TRUE(SetupSync()); |
90 | 95 |
91 int i = 0; | 96 int i = 0; |
92 | 97 |
93 const int kNumApps = 5; | 98 const int kNumApps = 5; |
94 for (int j = 0; j < kNumApps; ++i, ++j) { | 99 for (int j = 0; j < kNumApps; ++i, ++j) { |
95 InstallApp(GetProfile(0), i); | 100 InstallApp(GetProfile(0), i); |
96 InstallApp(verifier(), i); | 101 InstallApp(verifier(), i); |
97 } | 102 } |
98 | 103 |
99 const int kNumPlatformApps = 5; | 104 const int kNumPlatformApps = 5; |
100 for (int j = 0; j < kNumPlatformApps; ++i, ++j) { | 105 for (int j = 0; j < kNumPlatformApps; ++i, ++j) { |
101 InstallPlatformApp(GetProfile(0), i); | 106 InstallPlatformApp(GetProfile(0), i); |
102 InstallPlatformApp(verifier(), i); | 107 InstallPlatformApp(verifier(), i); |
103 } | 108 } |
104 | 109 |
105 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion( | 110 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion( |
106 "Waiting for app changes.")); | 111 "Waiting for app changes.")); |
107 | 112 |
108 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); | 113 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
| 114 |
| 115 WaitForPlatformAppsToUnload(); |
109 } | 116 } |
OLD | NEW |