OLD | NEW |
---|---|
1 // Copyright (c) 2012 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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
12 #include "base/values.h" | 12 #include "base/values.h" |
13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
14 #include "chrome/browser/web_resource/notification_promo.h" | 14 #include "chrome/browser/web_resource/notification_promo.h" |
15 #include "chrome/browser/web_resource/promo_resource_service.h" | 15 #include "chrome/browser/web_resource/promo_resource_service.h" |
16 #include "chrome/common/chrome_notification_types.h" | 16 #include "chrome/common/chrome_notification_types.h" |
17 #include "chrome/common/pref_names.h" | 17 #include "chrome/common/pref_names.h" |
18 #include "chrome/test/base/testing_browser_process.h" | 18 #include "chrome/test/base/testing_browser_process.h" |
19 #include "chrome/test/base/testing_pref_service.h" | 19 #include "chrome/test/base/testing_pref_service_syncable.h" |
Mattias Nissler (ping if slow)
2013/02/12 13:53:32
testing_pref_service.h suffices?
| |
20 #include "content/public/browser/notification_registrar.h" | 20 #include "content/public/browser/notification_registrar.h" |
21 #include "content/public/browser/notification_service.h" | 21 #include "content/public/browser/notification_service.h" |
22 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
23 | 23 |
24 #include "chrome/browser/web_resource/notification_promo_mobile_ntp.h" | 24 #include "chrome/browser/web_resource/notification_promo_mobile_ntp.h" |
25 | 25 |
26 class PromoResourceServiceMobileNtpTest : public testing::Test { | 26 class PromoResourceServiceMobileNtpTest : public testing::Test { |
27 public: | 27 public: |
28 // |promo_resource_service_| must be created after |local_state_|. | 28 // |promo_resource_service_| must be created after |local_state_|. |
29 PromoResourceServiceMobileNtpTest() | 29 PromoResourceServiceMobileNtpTest() |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
173 "It\'s simple. Go http://www.google.com/chrome/", | 173 "It\'s simple. Go http://www.google.com/chrome/", |
174 "ACTION_EMAIL", "This is the body.", "XXX value"); | 174 "ACTION_EMAIL", "This is the body.", "XXX value"); |
175 | 175 |
176 promo_test.InitPromoFromJson(true); | 176 promo_test.InitPromoFromJson(true); |
177 | 177 |
178 // Second time should not trigger a notification. | 178 // Second time should not trigger a notification. |
179 promo_test.InitPromoFromJson(false); | 179 promo_test.InitPromoFromJson(false); |
180 | 180 |
181 promo_test.TestInitFromPrefs(); | 181 promo_test.TestInitFromPrefs(); |
182 } | 182 } |
OLD | NEW |