Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: chrome/browser/instant/promo_counter_unittest.cc

Issue 7744039: Switch ChromeTestSuite to the same convention as ContentTestSuite: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more fixing Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
7 #include "chrome/test/base/testing_profile.h" 6 #include "chrome/test/base/testing_profile.h"
8 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
9 8
10 typedef TestingBrowserProcessTest PromoCounterTest; 9 typedef testing::Test PromoCounterTest;
11 10
12 // Makes sure ShouldShow returns false after the max number of days. 11 // Makes sure ShouldShow returns false after the max number of days.
13 TEST_F(PromoCounterTest, MaxTimeElapsed) { 12 TEST_F(PromoCounterTest, MaxTimeElapsed) {
14 TestingProfile profile; 13 TestingProfile profile;
15 PromoCounter::RegisterUserPrefs(profile.GetPrefs(), "test"); 14 PromoCounter::RegisterUserPrefs(profile.GetPrefs(), "test");
16 15
17 base::Time test_time(base::Time::Now()); 16 base::Time test_time(base::Time::Now());
18 PromoCounter counter(&profile, "test", "test", 2, 2); 17 PromoCounter counter(&profile, "test", "test", 2, 2);
19 ASSERT_TRUE(counter.ShouldShow(test_time)); 18 ASSERT_TRUE(counter.ShouldShow(test_time));
20 ASSERT_TRUE(counter.ShouldShow(test_time + base::TimeDelta::FromHours(2))); 19 ASSERT_TRUE(counter.ShouldShow(test_time + base::TimeDelta::FromHours(2)));
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 ASSERT_TRUE(counter.ShouldShow(test_time)); 72 ASSERT_TRUE(counter.ShouldShow(test_time));
74 counter.Hide(); 73 counter.Hide();
75 ASSERT_FALSE(counter.ShouldShow(test_time)); 74 ASSERT_FALSE(counter.ShouldShow(test_time));
76 } 75 }
77 76
78 { 77 {
79 PromoCounter counter(&profile, "test", "test", 2, 2); 78 PromoCounter counter(&profile, "test", "test", 2, 2);
80 ASSERT_FALSE(counter.ShouldShow(test_time)); 79 ASSERT_FALSE(counter.ShouldShow(test_time));
81 } 80 }
82 } 81 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698