| 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 themes_helper::AwaitThemeIsPendingInstall; | 11 using themes_helper::AwaitThemeIsPendingInstall; |
| 12 using themes_helper::AwaitUsingSystemTheme; | 12 using themes_helper::AwaitUsingSystemTheme; |
| 13 using themes_helper::AwaitUsingDefaultTheme; | 13 using themes_helper::AwaitUsingDefaultTheme; |
| 14 using themes_helper::GetCustomTheme; | 14 using themes_helper::GetCustomTheme; |
| 15 using themes_helper::GetThemeID; | 15 using themes_helper::GetThemeID; |
| 16 using themes_helper::UseCustomTheme; | 16 using themes_helper::UseCustomTheme; |
| 17 using themes_helper::UseDefaultTheme; | 17 using themes_helper::UseDefaultTheme; |
| 18 using themes_helper::UseSystemTheme; | 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::UsingSystemTheme; | 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 virtual bool TestUsesSelfNotifications() OVERRIDE { | 28 virtual bool TestUsesSelfNotifications() override { |
| 29 return false; | 29 return false; |
| 30 } | 30 } |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 DISALLOW_COPY_AND_ASSIGN(TwoClientThemesSyncTest); | 33 DISALLOW_COPY_AND_ASSIGN(TwoClientThemesSyncTest); |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 // Starts with default themes, then sets up sync and uses it to set all | 36 // Starts with default themes, then sets up sync and uses it to set all |
| 37 // profiles to use a custom theme. Does not actually install any themes, but | 37 // profiles to use a custom theme. Does not actually install any themes, but |
| 38 // instead verifies the custom theme is pending for install. | 38 // instead verifies the custom theme is pending for install. |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 EXPECT_TRUE(UsingDefaultTheme(GetProfile(0))); | 132 EXPECT_TRUE(UsingDefaultTheme(GetProfile(0))); |
| 133 EXPECT_TRUE(UsingDefaultTheme(GetProfile(1))); | 133 EXPECT_TRUE(UsingDefaultTheme(GetProfile(1))); |
| 134 EXPECT_TRUE(UsingDefaultTheme(verifier())); | 134 EXPECT_TRUE(UsingDefaultTheme(verifier())); |
| 135 | 135 |
| 136 UseCustomTheme(GetProfile(0), 1); | 136 UseCustomTheme(GetProfile(0), 1); |
| 137 UseCustomTheme(verifier(), 1); | 137 UseCustomTheme(verifier(), 1); |
| 138 ASSERT_TRUE(AwaitThemeIsPendingInstall(GetProfile(1), GetCustomTheme(1))); | 138 ASSERT_TRUE(AwaitThemeIsPendingInstall(GetProfile(1), GetCustomTheme(1))); |
| 139 EXPECT_EQ(GetCustomTheme(1), GetThemeID(GetProfile(0))); | 139 EXPECT_EQ(GetCustomTheme(1), GetThemeID(GetProfile(0))); |
| 140 EXPECT_EQ(GetCustomTheme(1), GetThemeID(verifier())); | 140 EXPECT_EQ(GetCustomTheme(1), GetThemeID(verifier())); |
| 141 } | 141 } |
| OLD | NEW |