| OLD | NEW |
| 1 // Copyright (c) 2011 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 "chrome/browser/google/google_util.h" | 5 #include "chrome/browser/google/google_util.h" |
| 6 #include "chrome/installer/util/google_update_settings.h" | 6 #include "chrome/installer/util/google_update_settings.h" |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 #include "testing/platform_test.h" | 8 #include "testing/platform_test.h" |
| 9 | 9 |
| 10 class GoogleUpdateTest : public PlatformTest { | 10 class GoogleUpdateTest : public PlatformTest { |
| 11 }; | 11 }; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 28 EXPECT_TRUE(GoogleUpdateSettings::RemoveLastRunTime()); | 28 EXPECT_TRUE(GoogleUpdateSettings::RemoveLastRunTime()); |
| 29 EXPECT_EQ(-1, GoogleUpdateSettings::GetLastRunTime()); | 29 EXPECT_EQ(-1, GoogleUpdateSettings::GetLastRunTime()); |
| 30 // Setting and querying the last update time in fast sequence | 30 // Setting and querying the last update time in fast sequence |
| 31 // should give 0 days. | 31 // should give 0 days. |
| 32 EXPECT_TRUE(GoogleUpdateSettings::SetLastRunTime()); | 32 EXPECT_TRUE(GoogleUpdateSettings::SetLastRunTime()); |
| 33 EXPECT_EQ(0, GoogleUpdateSettings::GetLastRunTime()); | 33 EXPECT_EQ(0, GoogleUpdateSettings::GetLastRunTime()); |
| 34 } | 34 } |
| 35 | 35 |
| 36 #endif // defined(OS_WIN) | 36 #endif // defined(OS_WIN) |
| 37 | 37 |
| 38 TEST_F(GoogleUpdateTest, ShouldShowSearchEngineDialog) { | 38 TEST_F(GoogleUpdateTest, IsOrganicFirstRunBrandCodes) { |
| 39 // Test some brand codes to ensure that future changes to this method won't | 39 // Test some brand codes to ensure that future changes to this method won't |
| 40 // go unnoticed. | 40 // go unnoticed. |
| 41 EXPECT_FALSE(google_util::IsOrganicFirstRun("CHFO")); | 41 EXPECT_FALSE(google_util::IsOrganicFirstRun("CHFO")); |
| 42 EXPECT_FALSE(google_util::IsOrganicFirstRun("CHMA")); | 42 EXPECT_FALSE(google_util::IsOrganicFirstRun("CHMA")); |
| 43 EXPECT_TRUE(google_util::IsOrganicFirstRun("EUBA")); | 43 EXPECT_TRUE(google_util::IsOrganicFirstRun("EUBA")); |
| 44 EXPECT_TRUE(google_util::IsOrganicFirstRun("GGRA")); | 44 EXPECT_TRUE(google_util::IsOrganicFirstRun("GGRA")); |
| 45 | 45 |
| 46 #if defined(OS_MACOSX) | 46 #if defined(OS_MACOSX) |
| 47 // An empty brand string on Mac is used for channels other than stable, | 47 // An empty brand string on Mac is used for channels other than stable, |
| 48 // which are always organic. | 48 // which are always organic. |
| 49 EXPECT_TRUE(google_util::IsOrganicFirstRun("")); | 49 EXPECT_TRUE(google_util::IsOrganicFirstRun("")); |
| 50 #endif | 50 #endif |
| 51 } | 51 } |
| OLD | NEW |