| 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 "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/test/scoped_path_override.h" | 8 #include "base/test/scoped_path_override.h" |
| 9 #include "chrome/browser/google/google_brand.h" |
| 9 #include "chrome/browser/google/google_util.h" | 10 #include "chrome/browser/google/google_util.h" |
| 10 #include "chrome/common/chrome_paths.h" | 11 #include "chrome/common/chrome_paths.h" |
| 11 #include "chrome/installer/util/google_update_settings.h" | 12 #include "chrome/installer/util/google_update_settings.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 13 #include "testing/platform_test.h" | 14 #include "testing/platform_test.h" |
| 14 | 15 |
| 15 class GoogleUpdateTest : public PlatformTest { | 16 class GoogleUpdateTest : public PlatformTest { |
| 16 protected: | 17 protected: |
| 17 GoogleUpdateTest() : user_data_dir_override_(chrome::DIR_USER_DATA) {} | 18 GoogleUpdateTest() : user_data_dir_override_(chrome::DIR_USER_DATA) {} |
| 18 virtual ~GoogleUpdateTest() {} | 19 virtual ~GoogleUpdateTest() {} |
| (...skipping 25 matching lines...) Expand all Loading... |
| 44 // should give 0 days. | 45 // should give 0 days. |
| 45 EXPECT_TRUE(GoogleUpdateSettings::SetLastRunTime()); | 46 EXPECT_TRUE(GoogleUpdateSettings::SetLastRunTime()); |
| 46 EXPECT_EQ(0, GoogleUpdateSettings::GetLastRunTime()); | 47 EXPECT_EQ(0, GoogleUpdateSettings::GetLastRunTime()); |
| 47 } | 48 } |
| 48 | 49 |
| 49 #endif // defined(OS_WIN) | 50 #endif // defined(OS_WIN) |
| 50 | 51 |
| 51 TEST_F(GoogleUpdateTest, IsOrganicFirstRunBrandCodes) { | 52 TEST_F(GoogleUpdateTest, IsOrganicFirstRunBrandCodes) { |
| 52 // Test some brand codes to ensure that future changes to this method won't | 53 // Test some brand codes to ensure that future changes to this method won't |
| 53 // go unnoticed. | 54 // go unnoticed. |
| 54 EXPECT_FALSE(google_util::IsOrganicFirstRun("CHFO")); | 55 EXPECT_FALSE(google_brand::IsOrganicFirstRun("CHFO")); |
| 55 EXPECT_FALSE(google_util::IsOrganicFirstRun("CHMA")); | 56 EXPECT_FALSE(google_brand::IsOrganicFirstRun("CHMA")); |
| 56 EXPECT_TRUE(google_util::IsOrganicFirstRun("EUBA")); | 57 EXPECT_TRUE(google_brand::IsOrganicFirstRun("EUBA")); |
| 57 EXPECT_TRUE(google_util::IsOrganicFirstRun("GGRA")); | 58 EXPECT_TRUE(google_brand::IsOrganicFirstRun("GGRA")); |
| 58 | 59 |
| 59 #if defined(OS_MACOSX) | 60 #if defined(OS_MACOSX) |
| 60 // An empty brand string on Mac is used for channels other than stable, | 61 // An empty brand string on Mac is used for channels other than stable, |
| 61 // which are always organic. | 62 // which are always organic. |
| 62 EXPECT_TRUE(google_util::IsOrganicFirstRun("")); | 63 EXPECT_TRUE(google_brand::IsOrganicFirstRun("")); |
| 63 #endif | 64 #endif |
| 64 } | 65 } |
| OLD | NEW |