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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
312 | 312 |
313 int max_views_; | 313 int max_views_; |
314 | 314 |
315 bool closed_; | 315 bool closed_; |
316 }; | 316 }; |
317 | 317 |
318 // Test that everything gets parsed correctly, notifications are sent, | 318 // Test that everything gets parsed correctly, notifications are sent, |
319 // and CanShow() is handled correctly under variety of conditions. | 319 // and CanShow() is handled correctly under variety of conditions. |
320 // Additionally, test that the first string in |strings| is used if | 320 // Additionally, test that the first string in |strings| is used if |
321 // no payload.promo_short_message is specified in the JSON response. | 321 // no payload.promo_short_message is specified in the JSON response. |
322 TEST_F(PromoResourceServiceTest, NotificationPromoTest) { | 322 |
323 // hardcoded a date in Jan 2013. Srzly?? http://crbug.com/168561 | |
Dan Beam
2013/01/07 15:59:36
hahaha, I'll fix this.
| |
324 TEST_F(PromoResourceServiceTest, DISABLED_NotificationPromoTest) { | |
323 // Check that prefs are set correctly. | 325 // Check that prefs are set correctly. |
324 NotificationPromoTest promo_test; | 326 NotificationPromoTest promo_test; |
325 | 327 |
326 // Set up start and end dates and promo line in a Dictionary as if parsed | 328 // Set up start and end dates and promo line in a Dictionary as if parsed |
327 // from the service. | 329 // from the service. |
328 promo_test.Init("{" | 330 promo_test.Init("{" |
329 " \"ntp_notification_promo\": [" | 331 " \"ntp_notification_promo\": [" |
330 " {" | 332 " {" |
331 " \"date\":" | 333 " \"date\":" |
332 " [" | 334 " [" |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
485 promo_test.TestInitFromPrefs(); | 487 promo_test.TestInitFromPrefs(); |
486 } | 488 } |
487 | 489 |
488 TEST_F(PromoResourceServiceTest, PromoServerURLTest) { | 490 TEST_F(PromoResourceServiceTest, PromoServerURLTest) { |
489 GURL promo_server_url = NotificationPromo::PromoServerURL(); | 491 GURL promo_server_url = NotificationPromo::PromoServerURL(); |
490 EXPECT_FALSE(promo_server_url.is_empty()); | 492 EXPECT_FALSE(promo_server_url.is_empty()); |
491 EXPECT_TRUE(promo_server_url.is_valid()); | 493 EXPECT_TRUE(promo_server_url.is_valid()); |
492 EXPECT_TRUE(promo_server_url.SchemeIs(chrome::kHttpsScheme)); | 494 EXPECT_TRUE(promo_server_url.SchemeIs(chrome::kHttpsScheme)); |
493 // TODO(achuith): Test this better. | 495 // TODO(achuith): Test this better. |
494 } | 496 } |
OLD | NEW |