OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/test/integration/profile_sync_service_harness.h" | 6 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" |
7 #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" | 7 #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" |
8 #include "chrome/browser/sync/test/integration/sync_test.h" | 8 #include "chrome/browser/sync/test/integration/sync_test.h" |
9 #include "chrome/browser/sync/test/integration/themes_helper.h" | 9 #include "chrome/browser/sync/test/integration/themes_helper.h" |
10 | 10 |
11 using sync_integration_test_util::AwaitCommitActivityCompletion; | 11 using sync_integration_test_util::AwaitCommitActivityCompletion; |
12 using themes_helper::GetCustomTheme; | 12 using themes_helper::GetCustomTheme; |
13 using themes_helper::GetThemeID; | 13 using themes_helper::GetThemeID; |
14 using themes_helper::HasOrWillHaveCustomTheme; | 14 using themes_helper::HasOrWillHaveCustomTheme; |
15 using themes_helper::ThemeIsPendingInstall; | 15 using themes_helper::ThemeIsPendingInstall; |
16 using themes_helper::UseCustomTheme; | 16 using themes_helper::UseCustomTheme; |
17 using themes_helper::UseDefaultTheme; | 17 using themes_helper::UseDefaultTheme; |
18 using themes_helper::UseNativeTheme; | 18 using themes_helper::UseSystemTheme; |
19 using themes_helper::UsingCustomTheme; | 19 using themes_helper::UsingCustomTheme; |
20 using themes_helper::UsingDefaultTheme; | 20 using themes_helper::UsingDefaultTheme; |
21 using themes_helper::UsingNativeTheme; | 21 using themes_helper::UsingSystemTheme; |
22 | 22 |
23 class TwoClientThemesSyncTest : public SyncTest { | 23 class TwoClientThemesSyncTest : public SyncTest { |
24 public: | 24 public: |
25 TwoClientThemesSyncTest() : SyncTest(TWO_CLIENT) {} | 25 TwoClientThemesSyncTest() : SyncTest(TWO_CLIENT) {} |
26 virtual ~TwoClientThemesSyncTest() {} | 26 virtual ~TwoClientThemesSyncTest() {} |
27 | 27 |
28 private: | 28 private: |
29 DISALLOW_COPY_AND_ASSIGN(TwoClientThemesSyncTest); | 29 DISALLOW_COPY_AND_ASSIGN(TwoClientThemesSyncTest); |
30 }; | 30 }; |
31 | 31 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, NativeTheme) { | 75 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, NativeTheme) { |
76 #endif // OS_CHROMEOS | 76 #endif // OS_CHROMEOS |
77 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 77 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
78 | 78 |
79 UseCustomTheme(GetProfile(0), 0); | 79 UseCustomTheme(GetProfile(0), 0); |
80 UseCustomTheme(GetProfile(1), 0); | 80 UseCustomTheme(GetProfile(1), 0); |
81 UseCustomTheme(verifier(), 0); | 81 UseCustomTheme(verifier(), 0); |
82 | 82 |
83 ASSERT_TRUE(AwaitQuiescence()); | 83 ASSERT_TRUE(AwaitQuiescence()); |
84 | 84 |
85 UseNativeTheme(GetProfile(0)); | 85 UseSystemTheme(GetProfile(0)); |
86 UseNativeTheme(verifier()); | 86 UseSystemTheme(verifier()); |
87 ASSERT_TRUE(UsingNativeTheme(GetProfile(0))); | 87 ASSERT_TRUE(UsingSystemTheme(GetProfile(0))); |
88 ASSERT_TRUE(UsingNativeTheme(verifier())); | 88 ASSERT_TRUE(UsingSystemTheme(verifier())); |
89 | 89 |
90 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 90 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
91 | 91 |
92 ASSERT_TRUE(UsingNativeTheme(GetProfile(0))); | 92 ASSERT_TRUE(UsingSystemTheme(GetProfile(0))); |
93 ASSERT_TRUE(UsingNativeTheme(GetProfile(1))); | 93 ASSERT_TRUE(UsingSystemTheme(GetProfile(1))); |
94 ASSERT_TRUE(UsingNativeTheme(verifier())); | 94 ASSERT_TRUE(UsingSystemTheme(verifier())); |
95 } | 95 } |
96 | 96 |
97 // TCM ID - 7247455. | 97 // TCM ID - 7247455. |
98 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, DefaultTheme) { | 98 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, DefaultTheme) { |
99 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 99 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
100 | 100 |
101 UseCustomTheme(GetProfile(0), 0); | 101 UseCustomTheme(GetProfile(0), 0); |
102 UseCustomTheme(GetProfile(1), 0); | 102 UseCustomTheme(GetProfile(1), 0); |
103 UseCustomTheme(verifier(), 0); | 103 UseCustomTheme(verifier(), 0); |
104 | 104 |
(...skipping 14 matching lines...) Expand all Loading... |
119 // TCM ID - 7292065. | 119 // TCM ID - 7292065. |
120 // TODO(sync): Fails on Chrome OS. See http://crbug.com/84575. | 120 // TODO(sync): Fails on Chrome OS. See http://crbug.com/84575. |
121 // TODO(erg): Fails on linux_aura. See http://crbug.com/304554 | 121 // TODO(erg): Fails on linux_aura. See http://crbug.com/304554 |
122 #if defined(OS_CHROMEOS) || defined(OS_LINUX) | 122 #if defined(OS_CHROMEOS) || defined(OS_LINUX) |
123 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, DISABLED_NativeDefaultRace) { | 123 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, DISABLED_NativeDefaultRace) { |
124 #else | 124 #else |
125 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, NativeDefaultRace) { | 125 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, NativeDefaultRace) { |
126 #endif // OS_CHROMEOS | 126 #endif // OS_CHROMEOS |
127 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 127 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
128 | 128 |
129 UseNativeTheme(GetProfile(0)); | 129 UseSystemTheme(GetProfile(0)); |
130 UseDefaultTheme(GetProfile(1)); | 130 UseDefaultTheme(GetProfile(1)); |
131 ASSERT_TRUE(UsingNativeTheme(GetProfile(0))); | 131 ASSERT_TRUE(UsingSystemTheme(GetProfile(0))); |
132 ASSERT_TRUE(UsingDefaultTheme(GetProfile(1))); | 132 ASSERT_TRUE(UsingDefaultTheme(GetProfile(1))); |
133 | 133 |
134 ASSERT_TRUE(AwaitQuiescence()); | 134 ASSERT_TRUE(AwaitQuiescence()); |
135 | 135 |
136 // TODO(akalin): Add function that compares two profiles to see if | 136 // TODO(akalin): Add function that compares two profiles to see if |
137 // they're at the same state. | 137 // they're at the same state. |
138 | 138 |
139 ASSERT_EQ(UsingNativeTheme(GetProfile(0)), | 139 ASSERT_EQ(UsingSystemTheme(GetProfile(0)), |
140 UsingNativeTheme(GetProfile(1))); | 140 UsingSystemTheme(GetProfile(1))); |
141 ASSERT_EQ(UsingDefaultTheme(GetProfile(0)), | 141 ASSERT_EQ(UsingDefaultTheme(GetProfile(0)), |
142 UsingDefaultTheme(GetProfile(1))); | 142 UsingDefaultTheme(GetProfile(1))); |
143 } | 143 } |
144 | 144 |
145 // TCM ID - 7294077. | 145 // TCM ID - 7294077. |
146 // TODO(sync): Fails on Chrome OS. See http://crbug.com/84575. | 146 // TODO(sync): Fails on Chrome OS. See http://crbug.com/84575. |
147 #if defined(OS_CHROMEOS) | 147 #if defined(OS_CHROMEOS) |
148 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, DISABLED_CustomNativeRace) { | 148 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, DISABLED_CustomNativeRace) { |
149 #else | 149 #else |
150 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, CustomNativeRace) { | 150 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, CustomNativeRace) { |
151 #endif // OS_CHROMEOS | 151 #endif // OS_CHROMEOS |
152 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 152 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
153 | 153 |
154 UseCustomTheme(GetProfile(0), 0); | 154 UseCustomTheme(GetProfile(0), 0); |
155 UseNativeTheme(GetProfile(1)); | 155 UseSystemTheme(GetProfile(1)); |
156 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); | 156 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); |
157 ASSERT_TRUE(UsingNativeTheme(GetProfile(1))); | 157 ASSERT_TRUE(UsingSystemTheme(GetProfile(1))); |
158 | 158 |
159 ASSERT_TRUE(AwaitQuiescence()); | 159 ASSERT_TRUE(AwaitQuiescence()); |
160 | 160 |
161 // TODO(akalin): Add function to wait for pending extensions to be | 161 // TODO(akalin): Add function to wait for pending extensions to be |
162 // installed. | 162 // installed. |
163 | 163 |
164 ASSERT_EQ(HasOrWillHaveCustomTheme(GetProfile(0), GetCustomTheme(0)), | 164 ASSERT_EQ(HasOrWillHaveCustomTheme(GetProfile(0), GetCustomTheme(0)), |
165 HasOrWillHaveCustomTheme(GetProfile(1), GetCustomTheme(0))); | 165 HasOrWillHaveCustomTheme(GetProfile(1), GetCustomTheme(0))); |
166 } | 166 } |
167 | 167 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 ASSERT_EQ(GetCustomTheme(0), GetThemeID(verifier())); | 249 ASSERT_EQ(GetCustomTheme(0), GetThemeID(verifier())); |
250 | 250 |
251 ASSERT_TRUE(GetClient(1)->EnableSyncForAllDatatypes()); | 251 ASSERT_TRUE(GetClient(1)->EnableSyncForAllDatatypes()); |
252 ASSERT_TRUE(AwaitQuiescence()); | 252 ASSERT_TRUE(AwaitQuiescence()); |
253 | 253 |
254 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); | 254 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); |
255 ASSERT_EQ(GetCustomTheme(0), GetThemeID(verifier())); | 255 ASSERT_EQ(GetCustomTheme(0), GetThemeID(verifier())); |
256 ASSERT_FALSE(UsingCustomTheme(GetProfile(1))); | 256 ASSERT_FALSE(UsingCustomTheme(GetProfile(1))); |
257 ASSERT_TRUE(ThemeIsPendingInstall(GetProfile(1), GetCustomTheme(0))); | 257 ASSERT_TRUE(ThemeIsPendingInstall(GetProfile(1), GetCustomTheme(0))); |
258 } | 258 } |
OLD | NEW |