OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/test/live_sync/live_themes_sync_test.h" | 5 #include "chrome/test/live_sync/live_themes_sync_test.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "chrome/common/extensions/extension.h" | 8 #include "chrome/common/extensions/extension.h" |
9 | 9 |
10 class TwoClientLiveThemesSyncTest : public LiveThemesSyncTest { | 10 class TwoClientLiveThemesSyncTest : public LiveThemesSyncTest { |
(...skipping 25 matching lines...) Expand all Loading... |
36 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 36 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
37 | 37 |
38 ASSERT_EQ(GetTheme(0), GetCustomTheme(GetProfile(0))); | 38 ASSERT_EQ(GetTheme(0), GetCustomTheme(GetProfile(0))); |
39 // TODO(akalin): Add functions to simulate when a pending extension | 39 // TODO(akalin): Add functions to simulate when a pending extension |
40 // is installed as well as when a pending extension fails to | 40 // is installed as well as when a pending extension fails to |
41 // install. | 41 // install. |
42 ASSERT_TRUE(ExtensionIsPendingInstall(GetProfile(1), GetTheme(0))); | 42 ASSERT_TRUE(ExtensionIsPendingInstall(GetProfile(1), GetTheme(0))); |
43 ASSERT_EQ(GetTheme(0), GetCustomTheme(verifier())); | 43 ASSERT_EQ(GetTheme(0), GetCustomTheme(verifier())); |
44 } | 44 } |
45 | 45 |
46 // TODO(sync): Remove FAILS_ annotation after http://crbug.com/63285 is fixed. | |
47 #if defined(OS_MACOSX) | |
48 IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, FAILS_NativeTheme) { | |
49 #else | |
50 IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, NativeTheme) { | 46 IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, NativeTheme) { |
51 #endif | |
52 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 47 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
53 | 48 |
54 SetTheme(GetProfile(0), GetTheme(0)); | 49 SetTheme(GetProfile(0), GetTheme(0)); |
55 SetTheme(GetProfile(1), GetTheme(0)); | 50 SetTheme(GetProfile(1), GetTheme(0)); |
56 SetTheme(verifier(), GetTheme(0)); | 51 SetTheme(verifier(), GetTheme(0)); |
57 | 52 |
58 ASSERT_TRUE(AwaitQuiescence()); | 53 ASSERT_TRUE(AwaitQuiescence()); |
59 | 54 |
60 GetProfile(0)->SetNativeTheme(); | 55 GetProfile(0)->SetNativeTheme(); |
61 verifier()->SetNativeTheme(); | 56 verifier()->SetNativeTheme(); |
62 ASSERT_TRUE(UsingNativeTheme(GetProfile(0))); | 57 ASSERT_TRUE(UsingNativeTheme(GetProfile(0))); |
63 ASSERT_FALSE(UsingNativeTheme(GetProfile(1))); | 58 ASSERT_FALSE(UsingNativeTheme(GetProfile(1))); |
64 ASSERT_TRUE(UsingNativeTheme(verifier())); | 59 ASSERT_TRUE(UsingNativeTheme(verifier())); |
65 | 60 |
66 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 61 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
67 | 62 |
68 ASSERT_TRUE(UsingNativeTheme(GetProfile(0))); | 63 ASSERT_TRUE(UsingNativeTheme(GetProfile(0))); |
69 ASSERT_TRUE(UsingNativeTheme(GetProfile(1))); | 64 ASSERT_TRUE(UsingNativeTheme(GetProfile(1))); |
70 ASSERT_TRUE(UsingNativeTheme(verifier())); | 65 ASSERT_TRUE(UsingNativeTheme(verifier())); |
71 } | 66 } |
72 | 67 |
73 // TODO(sync): Remove FAILS_ annotation after http://crbug.com/63285 is fixed. | |
74 #if defined(OS_MACOSX) | |
75 IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, FAILS_DefaultTheme) { | |
76 #else | |
77 IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, DefaultTheme) { | 68 IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, DefaultTheme) { |
78 #endif | |
79 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 69 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
80 | 70 |
81 SetTheme(GetProfile(0), GetTheme(0)); | 71 SetTheme(GetProfile(0), GetTheme(0)); |
82 SetTheme(GetProfile(1), GetTheme(0)); | 72 SetTheme(GetProfile(1), GetTheme(0)); |
83 SetTheme(verifier(), GetTheme(0)); | 73 SetTheme(verifier(), GetTheme(0)); |
84 | 74 |
85 ASSERT_TRUE(AwaitQuiescence()); | 75 ASSERT_TRUE(AwaitQuiescence()); |
86 | 76 |
87 GetProfile(0)->ClearTheme(); | 77 GetProfile(0)->ClearTheme(); |
88 verifier()->ClearTheme(); | 78 verifier()->ClearTheme(); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 bool using_theme_0 = | 152 bool using_theme_0 = |
163 (GetCustomTheme(GetProfile(0)) == GetTheme(0)) && | 153 (GetCustomTheme(GetProfile(0)) == GetTheme(0)) && |
164 HasOrWillHaveCustomTheme(GetProfile(1), GetTheme(0)); | 154 HasOrWillHaveCustomTheme(GetProfile(1), GetTheme(0)); |
165 bool using_theme_1 = | 155 bool using_theme_1 = |
166 HasOrWillHaveCustomTheme(GetProfile(0), GetTheme(1)) && | 156 HasOrWillHaveCustomTheme(GetProfile(0), GetTheme(1)) && |
167 (GetCustomTheme(GetProfile(1)) == GetTheme(1)); | 157 (GetCustomTheme(GetProfile(1)) == GetTheme(1)); |
168 | 158 |
169 // Equivalent to using_theme_0 xor using_theme_1. | 159 // Equivalent to using_theme_0 xor using_theme_1. |
170 ASSERT_NE(using_theme_0, using_theme_1); | 160 ASSERT_NE(using_theme_0, using_theme_1); |
171 } | 161 } |
OLD | NEW |