| 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.h" | 6 #include "chrome/browser/sync/profile_sync_service.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::UseCustomTheme; | 14 using themes_helper::UseCustomTheme; |
| 15 using themes_helper::UseDefaultTheme; | 15 using themes_helper::UseDefaultTheme; |
| 16 using themes_helper::UseNativeTheme; | 16 using themes_helper::UseSystemTheme; |
| 17 using themes_helper::UsingCustomTheme; | 17 using themes_helper::UsingCustomTheme; |
| 18 using themes_helper::UsingDefaultTheme; | 18 using themes_helper::UsingDefaultTheme; |
| 19 using themes_helper::UsingNativeTheme; | 19 using themes_helper::UsingSystemTheme; |
| 20 | 20 |
| 21 class SingleClientThemesSyncTest : public SyncTest { | 21 class SingleClientThemesSyncTest : public SyncTest { |
| 22 public: | 22 public: |
| 23 SingleClientThemesSyncTest() : SyncTest(SINGLE_CLIENT) {} | 23 SingleClientThemesSyncTest() : SyncTest(SINGLE_CLIENT) {} |
| 24 virtual ~SingleClientThemesSyncTest() {} | 24 virtual ~SingleClientThemesSyncTest() {} |
| 25 | 25 |
| 26 private: | 26 private: |
| 27 DISALLOW_COPY_AND_ASSIGN(SingleClientThemesSyncTest); | 27 DISALLOW_COPY_AND_ASSIGN(SingleClientThemesSyncTest); |
| 28 }; | 28 }; |
| 29 | 29 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 51 // TODO(sync): Fails on Chrome OS. See http://crbug.com/84575. | 51 // TODO(sync): Fails on Chrome OS. See http://crbug.com/84575. |
| 52 #if defined(OS_CHROMEOS) | 52 #if defined(OS_CHROMEOS) |
| 53 IN_PROC_BROWSER_TEST_F(SingleClientThemesSyncTest, DISABLED_NativeTheme) { | 53 IN_PROC_BROWSER_TEST_F(SingleClientThemesSyncTest, DISABLED_NativeTheme) { |
| 54 #else | 54 #else |
| 55 IN_PROC_BROWSER_TEST_F(SingleClientThemesSyncTest, NativeTheme) { | 55 IN_PROC_BROWSER_TEST_F(SingleClientThemesSyncTest, NativeTheme) { |
| 56 #endif // OS_CHROMEOS | 56 #endif // OS_CHROMEOS |
| 57 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 57 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 58 | 58 |
| 59 UseCustomTheme(GetProfile(0), 0); | 59 UseCustomTheme(GetProfile(0), 0); |
| 60 UseCustomTheme(verifier(), 0); | 60 UseCustomTheme(verifier(), 0); |
| 61 ASSERT_FALSE(UsingNativeTheme(GetProfile(0))); | 61 ASSERT_FALSE(UsingSystemTheme(GetProfile(0))); |
| 62 ASSERT_FALSE(UsingNativeTheme(verifier())); | 62 ASSERT_FALSE(UsingSystemTheme(verifier())); |
| 63 | 63 |
| 64 ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0)))); | 64 ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0)))); |
| 65 | 65 |
| 66 UseNativeTheme(GetProfile(0)); | 66 UseSystemTheme(GetProfile(0)); |
| 67 UseNativeTheme(verifier()); | 67 UseSystemTheme(verifier()); |
| 68 ASSERT_TRUE(UsingNativeTheme(GetProfile(0))); | 68 ASSERT_TRUE(UsingSystemTheme(GetProfile(0))); |
| 69 ASSERT_TRUE(UsingNativeTheme(verifier())); | 69 ASSERT_TRUE(UsingSystemTheme(verifier())); |
| 70 | 70 |
| 71 ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0)))); | 71 ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0)))); |
| 72 | 72 |
| 73 ASSERT_TRUE(UsingNativeTheme(GetProfile(0))); | 73 ASSERT_TRUE(UsingSystemTheme(GetProfile(0))); |
| 74 ASSERT_TRUE(UsingNativeTheme(verifier())); | 74 ASSERT_TRUE(UsingSystemTheme(verifier())); |
| 75 } | 75 } |
| 76 | 76 |
| 77 IN_PROC_BROWSER_TEST_F(SingleClientThemesSyncTest, DefaultTheme) { | 77 IN_PROC_BROWSER_TEST_F(SingleClientThemesSyncTest, DefaultTheme) { |
| 78 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 78 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 79 | 79 |
| 80 UseCustomTheme(GetProfile(0), 0); | 80 UseCustomTheme(GetProfile(0), 0); |
| 81 UseCustomTheme(verifier(), 0); | 81 UseCustomTheme(verifier(), 0); |
| 82 ASSERT_FALSE(UsingDefaultTheme(GetProfile(0))); | 82 ASSERT_FALSE(UsingDefaultTheme(GetProfile(0))); |
| 83 ASSERT_FALSE(UsingDefaultTheme(verifier())); | 83 ASSERT_FALSE(UsingDefaultTheme(verifier())); |
| 84 | 84 |
| 85 ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0)))); | 85 ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0)))); |
| 86 | 86 |
| 87 UseDefaultTheme(GetProfile(0)); | 87 UseDefaultTheme(GetProfile(0)); |
| 88 UseDefaultTheme(verifier()); | 88 UseDefaultTheme(verifier()); |
| 89 ASSERT_TRUE(UsingDefaultTheme(GetProfile(0))); | 89 ASSERT_TRUE(UsingDefaultTheme(GetProfile(0))); |
| 90 ASSERT_TRUE(UsingDefaultTheme(verifier())); | 90 ASSERT_TRUE(UsingDefaultTheme(verifier())); |
| 91 | 91 |
| 92 ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0)))); | 92 ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0)))); |
| 93 | 93 |
| 94 ASSERT_TRUE(UsingDefaultTheme(GetProfile(0))); | 94 ASSERT_TRUE(UsingDefaultTheme(GetProfile(0))); |
| 95 ASSERT_TRUE(UsingDefaultTheme(verifier())); | 95 ASSERT_TRUE(UsingDefaultTheme(verifier())); |
| 96 } | 96 } |
| OLD | NEW |