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 "build/build_config.h" | 6 #include "build/build_config.h" |
7 #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" | |
8 #include "chrome/browser/sync/test/integration/sync_test.h" | 7 #include "chrome/browser/sync/test/integration/sync_test.h" |
9 #include "chrome/browser/sync/test/integration/themes_helper.h" | 8 #include "chrome/browser/sync/test/integration/themes_helper.h" |
| 9 #include "chrome/browser/sync/test/integration/updated_progress_marker_checker.h
" |
10 #include "components/browser_sync/profile_sync_service.h" | 10 #include "components/browser_sync/profile_sync_service.h" |
11 | 11 |
12 using sync_integration_test_util::AwaitCommitActivityCompletion; | |
13 using themes_helper::GetCustomTheme; | 12 using themes_helper::GetCustomTheme; |
14 using themes_helper::GetThemeID; | 13 using themes_helper::GetThemeID; |
15 using themes_helper::UseCustomTheme; | 14 using themes_helper::UseCustomTheme; |
16 using themes_helper::UseDefaultTheme; | 15 using themes_helper::UseDefaultTheme; |
17 using themes_helper::UseSystemTheme; | 16 using themes_helper::UseSystemTheme; |
18 using themes_helper::UsingCustomTheme; | 17 using themes_helper::UsingCustomTheme; |
19 using themes_helper::UsingDefaultTheme; | 18 using themes_helper::UsingDefaultTheme; |
20 using themes_helper::UsingSystemTheme; | 19 using themes_helper::UsingSystemTheme; |
21 | 20 |
22 class SingleClientThemesSyncTest : public SyncTest { | 21 class SingleClientThemesSyncTest : public SyncTest { |
(...skipping 13 matching lines...) Expand all Loading... |
36 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 35 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
37 | 36 |
38 ASSERT_FALSE(UsingCustomTheme(GetProfile(0))); | 37 ASSERT_FALSE(UsingCustomTheme(GetProfile(0))); |
39 ASSERT_FALSE(UsingCustomTheme(verifier())); | 38 ASSERT_FALSE(UsingCustomTheme(verifier())); |
40 | 39 |
41 UseCustomTheme(GetProfile(0), 0); | 40 UseCustomTheme(GetProfile(0), 0); |
42 UseCustomTheme(verifier(), 0); | 41 UseCustomTheme(verifier(), 0); |
43 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); | 42 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); |
44 ASSERT_EQ(GetCustomTheme(0), GetThemeID(verifier())); | 43 ASSERT_EQ(GetCustomTheme(0), GetThemeID(verifier())); |
45 | 44 |
46 ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService(0))); | 45 ASSERT_TRUE(UpdatedProgressMarkerChecker(GetSyncService(0)).Wait()); |
47 | 46 |
48 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); | 47 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); |
49 ASSERT_EQ(GetCustomTheme(0), GetThemeID(verifier())); | 48 ASSERT_EQ(GetCustomTheme(0), GetThemeID(verifier())); |
50 } | 49 } |
51 | 50 |
52 // TODO(sync): Fails on Chrome OS. See http://crbug.com/84575. | 51 // TODO(sync): Fails on Chrome OS. See http://crbug.com/84575. |
53 #if defined(OS_CHROMEOS) | 52 #if defined(OS_CHROMEOS) |
54 IN_PROC_BROWSER_TEST_F(SingleClientThemesSyncTest, DISABLED_NativeTheme) { | 53 IN_PROC_BROWSER_TEST_F(SingleClientThemesSyncTest, DISABLED_NativeTheme) { |
55 #else | 54 #else |
56 IN_PROC_BROWSER_TEST_F(SingleClientThemesSyncTest, NativeTheme) { | 55 IN_PROC_BROWSER_TEST_F(SingleClientThemesSyncTest, NativeTheme) { |
57 #endif // OS_CHROMEOS | 56 #endif // OS_CHROMEOS |
58 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 57 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
59 | 58 |
60 UseCustomTheme(GetProfile(0), 0); | 59 UseCustomTheme(GetProfile(0), 0); |
61 UseCustomTheme(verifier(), 0); | 60 UseCustomTheme(verifier(), 0); |
62 ASSERT_FALSE(UsingSystemTheme(GetProfile(0))); | 61 ASSERT_FALSE(UsingSystemTheme(GetProfile(0))); |
63 ASSERT_FALSE(UsingSystemTheme(verifier())); | 62 ASSERT_FALSE(UsingSystemTheme(verifier())); |
64 | 63 |
65 ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService(0))); | 64 ASSERT_TRUE(UpdatedProgressMarkerChecker(GetSyncService(0)).Wait()); |
66 | 65 |
67 UseSystemTheme(GetProfile(0)); | 66 UseSystemTheme(GetProfile(0)); |
68 UseSystemTheme(verifier()); | 67 UseSystemTheme(verifier()); |
69 ASSERT_TRUE(UsingSystemTheme(GetProfile(0))); | 68 ASSERT_TRUE(UsingSystemTheme(GetProfile(0))); |
70 ASSERT_TRUE(UsingSystemTheme(verifier())); | 69 ASSERT_TRUE(UsingSystemTheme(verifier())); |
71 | 70 |
72 ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService(0))); | 71 ASSERT_TRUE(UpdatedProgressMarkerChecker(GetSyncService(0)).Wait()); |
73 | 72 |
74 ASSERT_TRUE(UsingSystemTheme(GetProfile(0))); | 73 ASSERT_TRUE(UsingSystemTheme(GetProfile(0))); |
75 ASSERT_TRUE(UsingSystemTheme(verifier())); | 74 ASSERT_TRUE(UsingSystemTheme(verifier())); |
76 } | 75 } |
77 | 76 |
78 IN_PROC_BROWSER_TEST_F(SingleClientThemesSyncTest, DefaultTheme) { | 77 IN_PROC_BROWSER_TEST_F(SingleClientThemesSyncTest, DefaultTheme) { |
79 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 78 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
80 | 79 |
81 UseCustomTheme(GetProfile(0), 0); | 80 UseCustomTheme(GetProfile(0), 0); |
82 UseCustomTheme(verifier(), 0); | 81 UseCustomTheme(verifier(), 0); |
83 ASSERT_FALSE(UsingDefaultTheme(GetProfile(0))); | 82 ASSERT_FALSE(UsingDefaultTheme(GetProfile(0))); |
84 ASSERT_FALSE(UsingDefaultTheme(verifier())); | 83 ASSERT_FALSE(UsingDefaultTheme(verifier())); |
85 | 84 |
86 ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService(0))); | 85 ASSERT_TRUE(UpdatedProgressMarkerChecker(GetSyncService(0)).Wait()); |
87 | 86 |
88 UseDefaultTheme(GetProfile(0)); | 87 UseDefaultTheme(GetProfile(0)); |
89 UseDefaultTheme(verifier()); | 88 UseDefaultTheme(verifier()); |
90 ASSERT_TRUE(UsingDefaultTheme(GetProfile(0))); | 89 ASSERT_TRUE(UsingDefaultTheme(GetProfile(0))); |
91 ASSERT_TRUE(UsingDefaultTheme(verifier())); | 90 ASSERT_TRUE(UsingDefaultTheme(verifier())); |
92 | 91 |
93 ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService(0))); | 92 ASSERT_TRUE(UpdatedProgressMarkerChecker(GetSyncService(0)).Wait()); |
94 | 93 |
95 ASSERT_TRUE(UsingDefaultTheme(GetProfile(0))); | 94 ASSERT_TRUE(UsingDefaultTheme(GetProfile(0))); |
96 ASSERT_TRUE(UsingDefaultTheme(verifier())); | 95 ASSERT_TRUE(UsingDefaultTheme(verifier())); |
97 } | 96 } |
OLD | NEW |