This source file includes following definitions.
- TEST_F
- TEST_F
- TEST_F
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/path_service.h"
#include "base/test/scoped_path_override.h"
#include "chrome/browser/google/google_util.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/installer/util/google_update_settings.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
class GoogleUpdateTest : public PlatformTest {
protected:
GoogleUpdateTest() : user_data_dir_override_(chrome::DIR_USER_DATA) {}
virtual ~GoogleUpdateTest() {}
private:
base::ScopedPathOverride user_data_dir_override_;
DISALLOW_COPY_AND_ASSIGN(GoogleUpdateTest);
};
TEST_F(GoogleUpdateTest, StatsConsent) {
EXPECT_FALSE(GoogleUpdateSettings::GetCollectStatsConsent());
EXPECT_TRUE(GoogleUpdateSettings::SetCollectStatsConsent(true));
EXPECT_TRUE(GoogleUpdateSettings::GetCollectStatsConsent());
EXPECT_TRUE(GoogleUpdateSettings::SetCollectStatsConsent(false));
EXPECT_FALSE(GoogleUpdateSettings::GetCollectStatsConsent());
}
#if defined(OS_WIN)
TEST_F(GoogleUpdateTest, LastRunTime) {
EXPECT_TRUE(GoogleUpdateSettings::RemoveLastRunTime());
EXPECT_EQ(-1, GoogleUpdateSettings::GetLastRunTime());
EXPECT_TRUE(GoogleUpdateSettings::SetLastRunTime());
EXPECT_EQ(0, GoogleUpdateSettings::GetLastRunTime());
}
#endif
TEST_F(GoogleUpdateTest, IsOrganicFirstRunBrandCodes) {
EXPECT_FALSE(google_util::IsOrganicFirstRun("CHFO"));
EXPECT_FALSE(google_util::IsOrganicFirstRun("CHMA"));
EXPECT_TRUE(google_util::IsOrganicFirstRun("EUBA"));
EXPECT_TRUE(google_util::IsOrganicFirstRun("GGRA"));
#if defined(OS_MACOSX)
EXPECT_TRUE(google_util::IsOrganicFirstRun(""));
#endif
}