OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/instant/promo_counter.h" | 5 #include "chrome/browser/instant/promo_counter.h" |
| 6 #include "chrome/test/base/testing_browser_process_test.h" |
6 #include "chrome/test/base/testing_profile.h" | 7 #include "chrome/test/base/testing_profile.h" |
7 #include "chrome/test/testing_browser_process_test.h" | |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 typedef TestingBrowserProcessTest PromoCounterTest; | 10 typedef TestingBrowserProcessTest PromoCounterTest; |
11 | 11 |
12 // Makes sure ShouldShow returns false after the max number of days. | 12 // Makes sure ShouldShow returns false after the max number of days. |
13 TEST_F(PromoCounterTest, MaxTimeElapsed) { | 13 TEST_F(PromoCounterTest, MaxTimeElapsed) { |
14 TestingProfile profile; | 14 TestingProfile profile; |
15 PromoCounter::RegisterUserPrefs(profile.GetPrefs(), "test"); | 15 PromoCounter::RegisterUserPrefs(profile.GetPrefs(), "test"); |
16 | 16 |
17 base::Time test_time(base::Time::Now()); | 17 base::Time test_time(base::Time::Now()); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 ASSERT_TRUE(counter.ShouldShow(test_time)); | 73 ASSERT_TRUE(counter.ShouldShow(test_time)); |
74 counter.Hide(); | 74 counter.Hide(); |
75 ASSERT_FALSE(counter.ShouldShow(test_time)); | 75 ASSERT_FALSE(counter.ShouldShow(test_time)); |
76 } | 76 } |
77 | 77 |
78 { | 78 { |
79 PromoCounter counter(&profile, "test", "test", 2, 2); | 79 PromoCounter counter(&profile, "test", "test", 2, 2); |
80 ASSERT_FALSE(counter.ShouldShow(test_time)); | 80 ASSERT_FALSE(counter.ShouldShow(test_time)); |
81 } | 81 } |
82 } | 82 } |
OLD | NEW |