OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/json/json_reader.h" | 5 #include "base/json/json_reader.h" |
6 #include "base/time.h" | 6 #include "base/time.h" |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/extensions/apps_promo.h" | 9 #include "chrome/browser/extensions/apps_promo.h" |
10 #include "chrome/browser/prefs/browser_prefs.h" | 10 #include "chrome/browser/prefs/browser_prefs.h" |
11 #include "chrome/browser/prefs/pref_service.h" | 11 #include "chrome/browser/prefs/pref_service.h" |
12 #include "chrome/browser/web_resource/promo_resource_service.h" | 12 #include "chrome/browser/web_resource/promo_resource_service.h" |
13 #include "chrome/common/pref_names.h" | 13 #include "chrome/common/pref_names.h" |
| 14 #include "chrome/test/base/testing_browser_process_test.h" |
14 #include "chrome/test/base/testing_pref_service.h" | 15 #include "chrome/test/base/testing_pref_service.h" |
15 #include "chrome/test/base/testing_profile.h" | 16 #include "chrome/test/base/testing_profile.h" |
16 #include "chrome/test/testing_browser_process_test.h" | |
17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
18 | 18 |
19 class PromoResourceServiceTest : public TestingBrowserProcessTest { | 19 class PromoResourceServiceTest : public TestingBrowserProcessTest { |
20 public: | 20 public: |
21 PromoResourceServiceTest() | 21 PromoResourceServiceTest() |
22 : local_state_(testing_browser_process_.get()), | 22 : local_state_(testing_browser_process_.get()), |
23 web_resource_service_(new PromoResourceService(&profile_)) { | 23 web_resource_service_(new PromoResourceService(&profile_)) { |
24 } | 24 } |
25 | 25 |
26 protected: | 26 protected: |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 const chrome::VersionInfo::Channel stable = | 264 const chrome::VersionInfo::Channel stable = |
265 chrome::VersionInfo::CHANNEL_STABLE; | 265 chrome::VersionInfo::CHANNEL_STABLE; |
266 EXPECT_FALSE(PromoResourceService::IsBuildTargeted(stable, 1)); | 266 EXPECT_FALSE(PromoResourceService::IsBuildTargeted(stable, 1)); |
267 EXPECT_FALSE(PromoResourceService::IsBuildTargeted(stable, 3)); | 267 EXPECT_FALSE(PromoResourceService::IsBuildTargeted(stable, 3)); |
268 EXPECT_TRUE(PromoResourceService::IsBuildTargeted(stable, 7)); | 268 EXPECT_TRUE(PromoResourceService::IsBuildTargeted(stable, 7)); |
269 EXPECT_TRUE(PromoResourceService::IsBuildTargeted(stable, 15)); | 269 EXPECT_TRUE(PromoResourceService::IsBuildTargeted(stable, 15)); |
270 EXPECT_FALSE(PromoResourceService::IsBuildTargeted(stable, 8)); | 270 EXPECT_FALSE(PromoResourceService::IsBuildTargeted(stable, 8)); |
271 EXPECT_FALSE(PromoResourceService::IsBuildTargeted(stable, 11)); | 271 EXPECT_FALSE(PromoResourceService::IsBuildTargeted(stable, 11)); |
272 EXPECT_TRUE(PromoResourceService::IsBuildTargeted(stable, 12)); | 272 EXPECT_TRUE(PromoResourceService::IsBuildTargeted(stable, 12)); |
273 } | 273 } |
OLD | NEW |