| 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/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "chrome/test/base/testing_pref_service.h" | 21 #include "chrome/test/base/testing_pref_service.h" |
| 22 #include "chrome/test/base/testing_profile.h" | 22 #include "chrome/test/base/testing_profile.h" |
| 23 #include "content/public/browser/notification_registrar.h" | 23 #include "content/public/browser/notification_registrar.h" |
| 24 #include "content/public/browser/notification_service.h" | 24 #include "content/public/browser/notification_service.h" |
| 25 #include "net/url_request/test_url_fetcher_factory.h" | 25 #include "net/url_request/test_url_fetcher_factory.h" |
| 26 #include "testing/gtest/include/gtest/gtest.h" | 26 #include "testing/gtest/include/gtest/gtest.h" |
| 27 | 27 |
| 28 class PromoResourceServiceTest : public testing::Test { | 28 class PromoResourceServiceTest : public testing::Test { |
| 29 public: | 29 public: |
| 30 PromoResourceServiceTest() | 30 PromoResourceServiceTest() |
| 31 : local_state_(static_cast<TestingBrowserProcess*>(g_browser_process)), | 31 : local_state_(TestingBrowserProcess::GetGlobal()), |
| 32 web_resource_service_(new PromoResourceService(&profile_)) { | 32 web_resource_service_(new PromoResourceService(&profile_)) { |
| 33 } | 33 } |
| 34 | 34 |
| 35 protected: | 35 protected: |
| 36 TestingProfile profile_; | 36 TestingProfile profile_; |
| 37 ScopedTestingLocalState local_state_; | 37 ScopedTestingLocalState local_state_; |
| 38 scoped_refptr<PromoResourceService> web_resource_service_; | 38 scoped_refptr<PromoResourceService> web_resource_service_; |
| 39 MessageLoop loop_; | 39 MessageLoop loop_; |
| 40 }; | 40 }; |
| 41 | 41 |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 promo_test.InitPromoFromJson(false); | 532 promo_test.InitPromoFromJson(false); |
| 533 promo_test.TestInitFromPrefs(); | 533 promo_test.TestInitFromPrefs(); |
| 534 } | 534 } |
| 535 | 535 |
| 536 TEST_F(PromoResourceServiceTest, PromoServerURLTest) { | 536 TEST_F(PromoResourceServiceTest, PromoServerURLTest) { |
| 537 GURL promo_server_url = NotificationPromo::PromoServerURL(); | 537 GURL promo_server_url = NotificationPromo::PromoServerURL(); |
| 538 EXPECT_FALSE(promo_server_url.is_empty()); | 538 EXPECT_FALSE(promo_server_url.is_empty()); |
| 539 EXPECT_TRUE(promo_server_url.SchemeIs("https")); | 539 EXPECT_TRUE(promo_server_url.SchemeIs("https")); |
| 540 // TODO(achuith): Test this better. | 540 // TODO(achuith): Test this better. |
| 541 } | 541 } |
| OLD | NEW |