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/macros.h" | 5 #include "base/macros.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 |
(...skipping 20 matching lines...) Expand all Loading... |
31 // Starts with default themes, then sets up sync and uses it to set all | 31 // Starts with default themes, then sets up sync and uses it to set all |
32 // profiles to use a custom theme. Does not actually install any themes, but | 32 // profiles to use a custom theme. Does not actually install any themes, but |
33 // instead verifies the custom theme is pending for install. | 33 // instead verifies the custom theme is pending for install. |
34 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, | 34 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, |
35 E2E_ENABLED(DefaultThenSyncCustom)) { | 35 E2E_ENABLED(DefaultThenSyncCustom)) { |
36 ASSERT_TRUE(SetupSync()); | 36 ASSERT_TRUE(SetupSync()); |
37 | 37 |
38 ASSERT_FALSE(UsingCustomTheme(GetProfile(0))); | 38 ASSERT_FALSE(UsingCustomTheme(GetProfile(0))); |
39 ASSERT_FALSE(UsingCustomTheme(GetProfile(1))); | 39 ASSERT_FALSE(UsingCustomTheme(GetProfile(1))); |
40 | 40 |
41 SetCustomTheme(GetProfile(0)); | 41 UseCustomTheme(GetProfile(0), 0); |
42 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); | 42 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); |
43 | 43 |
44 // TODO(sync): Add functions to simulate when a pending extension | 44 // TODO(sync): Add functions to simulate when a pending extension |
45 // is installed as well as when a pending extension fails to | 45 // is installed as well as when a pending extension fails to |
46 // install. | 46 // install. |
47 ASSERT_TRUE( | 47 ASSERT_TRUE( |
48 ThemePendingInstallChecker(GetProfile(1), GetCustomTheme(0)).Wait()); | 48 ThemePendingInstallChecker(GetProfile(1), GetCustomTheme(0)).Wait()); |
49 | 49 |
50 EXPECT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); | 50 EXPECT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); |
51 EXPECT_FALSE(UsingCustomTheme(GetProfile(1))); | 51 EXPECT_FALSE(UsingCustomTheme(GetProfile(1))); |
52 } | 52 } |
53 | 53 |
54 // Starts with custom themes, then sets up sync and uses it to set all profiles | 54 // Starts with custom themes, then sets up sync and uses it to set all profiles |
55 // to the system theme. | 55 // to the system theme. |
56 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, | 56 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, |
57 E2E_ENABLED(CustomThenSyncNative)) { | 57 E2E_ENABLED(CustomThenSyncNative)) { |
58 ASSERT_TRUE(SetupClients()); | 58 ASSERT_TRUE(SetupClients()); |
59 | 59 |
60 SetCustomTheme(GetProfile(0)); | 60 UseCustomTheme(GetProfile(0), 0); |
61 SetCustomTheme(GetProfile(1)); | 61 UseCustomTheme(GetProfile(1), 0); |
62 | 62 |
63 ASSERT_TRUE(SetupSync()); | 63 ASSERT_TRUE(SetupSync()); |
64 | 64 |
65 UseSystemTheme(GetProfile(0)); | 65 UseSystemTheme(GetProfile(0)); |
66 ASSERT_TRUE(UsingSystemTheme(GetProfile(0))); | 66 ASSERT_TRUE(UsingSystemTheme(GetProfile(0))); |
67 | 67 |
68 ASSERT_TRUE(SystemThemeChecker(GetProfile(1)).Wait()); | 68 ASSERT_TRUE(SystemThemeChecker(GetProfile(1)).Wait()); |
69 | 69 |
70 EXPECT_TRUE(UsingSystemTheme(GetProfile(0))); | 70 EXPECT_TRUE(UsingSystemTheme(GetProfile(0))); |
71 EXPECT_TRUE(UsingSystemTheme(GetProfile(1))); | 71 EXPECT_TRUE(UsingSystemTheme(GetProfile(1))); |
72 } | 72 } |
73 | 73 |
74 // Starts with custom themes, then sets up sync and uses it to set all profiles | 74 // Starts with custom themes, then sets up sync and uses it to set all profiles |
75 // to the default theme. | 75 // to the default theme. |
76 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, | 76 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, |
77 E2E_ENABLED(CustomThenSyncDefault)) { | 77 E2E_ENABLED(CustomThenSyncDefault)) { |
78 ASSERT_TRUE(SetupClients()); | 78 ASSERT_TRUE(SetupClients()); |
79 | 79 |
80 SetCustomTheme(GetProfile(0)); | 80 UseCustomTheme(GetProfile(0), 0); |
81 SetCustomTheme(GetProfile(1)); | 81 UseCustomTheme(GetProfile(1), 0); |
82 | 82 |
83 ASSERT_TRUE(SetupSync()); | 83 ASSERT_TRUE(SetupSync()); |
84 | 84 |
85 UseDefaultTheme(GetProfile(0)); | 85 UseDefaultTheme(GetProfile(0)); |
86 EXPECT_TRUE(UsingDefaultTheme(GetProfile(0))); | 86 EXPECT_TRUE(UsingDefaultTheme(GetProfile(0))); |
87 | 87 |
88 ASSERT_TRUE(DefaultThemeChecker(GetProfile(1)).Wait()); | 88 ASSERT_TRUE(DefaultThemeChecker(GetProfile(1)).Wait()); |
89 EXPECT_TRUE(UsingDefaultTheme(GetProfile(0))); | 89 EXPECT_TRUE(UsingDefaultTheme(GetProfile(0))); |
90 EXPECT_TRUE(UsingDefaultTheme(GetProfile(1))); | 90 EXPECT_TRUE(UsingDefaultTheme(GetProfile(1))); |
91 } | 91 } |
92 | 92 |
93 // Cycles through a set of options. | 93 // Cycles through a set of options. |
94 // | 94 // |
95 // Most other tests have significant coverage of model association. This test | 95 // Most other tests have significant coverage of model association. This test |
96 // is intended to test steady-state scenarios. | 96 // is intended to test steady-state scenarios. |
97 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, E2E_ENABLED(CycleOptions)) { | 97 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, E2E_ENABLED(CycleOptions)) { |
98 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 98 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
99 | 99 |
100 SetCustomTheme(GetProfile(0)); | 100 UseCustomTheme(GetProfile(0), 0); |
101 | 101 |
102 ASSERT_TRUE( | 102 ASSERT_TRUE( |
103 ThemePendingInstallChecker(GetProfile(1), GetCustomTheme(0)).Wait()); | 103 ThemePendingInstallChecker(GetProfile(1), GetCustomTheme(0)).Wait()); |
104 EXPECT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); | 104 EXPECT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); |
105 | 105 |
106 UseSystemTheme(GetProfile(0)); | 106 UseSystemTheme(GetProfile(0)); |
107 | 107 |
108 ASSERT_TRUE(SystemThemeChecker(GetProfile(1)).Wait()); | 108 ASSERT_TRUE(SystemThemeChecker(GetProfile(1)).Wait()); |
109 EXPECT_TRUE(UsingSystemTheme(GetProfile(0))); | 109 EXPECT_TRUE(UsingSystemTheme(GetProfile(0))); |
110 EXPECT_TRUE(UsingSystemTheme(GetProfile(1))); | 110 EXPECT_TRUE(UsingSystemTheme(GetProfile(1))); |
111 | 111 |
112 UseDefaultTheme(GetProfile(0)); | 112 UseDefaultTheme(GetProfile(0)); |
113 | 113 |
114 ASSERT_TRUE(DefaultThemeChecker(GetProfile(1)).Wait()); | 114 ASSERT_TRUE(DefaultThemeChecker(GetProfile(1)).Wait()); |
115 EXPECT_TRUE(UsingDefaultTheme(GetProfile(0))); | 115 EXPECT_TRUE(UsingDefaultTheme(GetProfile(0))); |
116 EXPECT_TRUE(UsingDefaultTheme(GetProfile(1))); | 116 EXPECT_TRUE(UsingDefaultTheme(GetProfile(1))); |
117 | 117 |
118 SetCustomTheme(GetProfile(0), 1); | 118 UseCustomTheme(GetProfile(0), 1); |
119 ASSERT_TRUE( | 119 ASSERT_TRUE( |
120 ThemePendingInstallChecker(GetProfile(1), GetCustomTheme(1)).Wait()); | 120 ThemePendingInstallChecker(GetProfile(1), GetCustomTheme(1)).Wait()); |
121 EXPECT_EQ(GetCustomTheme(1), GetThemeID(GetProfile(0))); | 121 EXPECT_EQ(GetCustomTheme(1), GetThemeID(GetProfile(0))); |
122 } | 122 } |
OLD | NEW |