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 "base/json/json_reader.h" | 5 #include "base/json/json_reader.h" |
6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
7 #include "base/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
8 #include "base/time.h" | 8 #include "base/time.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
12 #include "chrome/browser/prefs/browser_prefs.h" | 12 #include "chrome/browser/prefs/browser_prefs.h" |
13 #include "chrome/browser/prefs/pref_service.h" | 13 #include "chrome/browser/prefs/pref_service.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.h" |
20 #include "chrome/test/base/testing_profile.h" | 20 #include "chrome/test/base/testing_profile.h" |
21 #include "content/public/browser/notification_registrar.h" | 21 #include "content/public/browser/notification_registrar.h" |
22 #include "content/public/browser/notification_service.h" | 22 #include "content/public/browser/notification_service.h" |
23 #include "content/public/test/test_url_fetcher_factory.h" | 23 #include "net/url_request/test_url_fetcher_factory.h" |
24 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
25 | 25 |
26 class PromoResourceServiceTest : public testing::Test { | 26 class PromoResourceServiceTest : public testing::Test { |
27 public: | 27 public: |
28 PromoResourceServiceTest() | 28 PromoResourceServiceTest() |
29 : local_state_(static_cast<TestingBrowserProcess*>(g_browser_process)), | 29 : local_state_(static_cast<TestingBrowserProcess*>(g_browser_process)), |
30 web_resource_service_(new PromoResourceService(&profile_)) { | 30 web_resource_service_(new PromoResourceService(&profile_)) { |
31 } | 31 } |
32 | 32 |
33 protected: | 33 protected: |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 promo_test.TestIncrement(); | 408 promo_test.TestIncrement(); |
409 promo_test.TestGplus(); | 409 promo_test.TestGplus(); |
410 } | 410 } |
411 | 411 |
412 TEST_F(PromoResourceServiceTest, PromoServerURLTest) { | 412 TEST_F(PromoResourceServiceTest, PromoServerURLTest) { |
413 GURL promo_server_url = NotificationPromo::PromoServerURL(); | 413 GURL promo_server_url = NotificationPromo::PromoServerURL(); |
414 EXPECT_FALSE(promo_server_url.is_empty()); | 414 EXPECT_FALSE(promo_server_url.is_empty()); |
415 EXPECT_TRUE(promo_server_url.SchemeIs("https")); | 415 EXPECT_TRUE(promo_server_url.SchemeIs("https")); |
416 // TODO(achuith): Test this better. | 416 // TODO(achuith): Test this better. |
417 } | 417 } |
OLD | NEW |