| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <memory> |
| 7 #include <utility> | 8 #include <utility> |
| 8 #include <vector> | 9 #include <vector> |
| 9 | 10 |
| 10 #include "base/bind.h" | 11 #include "base/bind.h" |
| 11 #include "base/json/json_reader.h" | 12 #include "base/json/json_reader.h" |
| 12 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
| 13 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 14 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
| 15 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
| 16 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 | 322 |
| 322 const NotificationPromo& promo() const { return notification_promo_; } | 323 const NotificationPromo& promo() const { return notification_promo_; } |
| 323 | 324 |
| 324 protected: | 325 protected: |
| 325 TestingPrefServiceSimple local_state_; | 326 TestingPrefServiceSimple local_state_; |
| 326 | 327 |
| 327 private: | 328 private: |
| 328 base::MessageLoop loop_; | 329 base::MessageLoop loop_; |
| 329 NotificationPromo notification_promo_; | 330 NotificationPromo notification_promo_; |
| 330 bool received_notification_; | 331 bool received_notification_; |
| 331 scoped_ptr<base::DictionaryValue> test_json_; | 332 std::unique_ptr<base::DictionaryValue> test_json_; |
| 332 | 333 |
| 333 NotificationPromo::PromoType promo_type_; | 334 NotificationPromo::PromoType promo_type_; |
| 334 std::string promo_text_; | 335 std::string promo_text_; |
| 335 | 336 |
| 336 double start_; | 337 double start_; |
| 337 double end_; | 338 double end_; |
| 338 | 339 |
| 339 int num_groups_; | 340 int num_groups_; |
| 340 int initial_segment_; | 341 int initial_segment_; |
| 341 int increment_; | 342 int increment_; |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 | 511 |
| 511 TEST_F(NotificationPromoTest, PromoServerURLTest) { | 512 TEST_F(NotificationPromoTest, PromoServerURLTest) { |
| 512 GURL promo_server_url = NotificationPromo::PromoServerURL(kChannel); | 513 GURL promo_server_url = NotificationPromo::PromoServerURL(kChannel); |
| 513 EXPECT_FALSE(promo_server_url.is_empty()); | 514 EXPECT_FALSE(promo_server_url.is_empty()); |
| 514 EXPECT_TRUE(promo_server_url.is_valid()); | 515 EXPECT_TRUE(promo_server_url.is_valid()); |
| 515 EXPECT_TRUE(promo_server_url.SchemeIs(url::kHttpsScheme)); | 516 EXPECT_TRUE(promo_server_url.SchemeIs(url::kHttpsScheme)); |
| 516 // TODO(achuith): Test this better. | 517 // TODO(achuith): Test this better. |
| 517 } | 518 } |
| 518 | 519 |
| 519 } // namespace web_resource | 520 } // namespace web_resource |
| OLD | NEW |