| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/banners/app_banner_settings_helper.h" | 7 #include "chrome/browser/banners/app_banner_settings_helper.h" |
| 8 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 8 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| 9 | 9 |
| 10 namespace { | 10 namespace { |
| 11 | 11 |
| 12 const char kTestURL[] = "http://www.google.com"; | 12 const char kTestURL[] = "https://www.google.com"; |
| 13 const char kTestPackageName[] = "test.package"; | 13 const char kTestPackageName[] = "test.package"; |
| 14 | 14 |
| 15 base::Time GetReferenceTime() { | 15 base::Time GetReferenceTime() { |
| 16 base::Time::Exploded exploded_reference_time; | 16 base::Time::Exploded exploded_reference_time; |
| 17 exploded_reference_time.year = 2015; | 17 exploded_reference_time.year = 2015; |
| 18 exploded_reference_time.month = 1; | 18 exploded_reference_time.month = 1; |
| 19 exploded_reference_time.day_of_month = 30; | 19 exploded_reference_time.day_of_month = 30; |
| 20 exploded_reference_time.day_of_week = 5; | 20 exploded_reference_time.day_of_week = 5; |
| 21 exploded_reference_time.hour = 11; | 21 exploded_reference_time.hour = 11; |
| 22 exploded_reference_time.minute = 0; | 22 exploded_reference_time.minute = 0; |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 web_contents(), url, kTestPackageName, reference_time)); | 283 web_contents(), url, kTestPackageName, reference_time)); |
| 284 | 284 |
| 285 // Add the site a long time ago. It should not be shown. | 285 // Add the site a long time ago. It should not be shown. |
| 286 AppBannerSettingsHelper::RecordBannerEvent( | 286 AppBannerSettingsHelper::RecordBannerEvent( |
| 287 web_contents(), url, kTestPackageName, | 287 web_contents(), url, kTestPackageName, |
| 288 AppBannerSettingsHelper::APP_BANNER_EVENT_DID_ADD_TO_HOMESCREEN, | 288 AppBannerSettingsHelper::APP_BANNER_EVENT_DID_ADD_TO_HOMESCREEN, |
| 289 one_year_ago); | 289 one_year_ago); |
| 290 EXPECT_FALSE(AppBannerSettingsHelper::ShouldShowBanner( | 290 EXPECT_FALSE(AppBannerSettingsHelper::ShouldShowBanner( |
| 291 web_contents(), url, kTestPackageName, reference_time)); | 291 web_contents(), url, kTestPackageName, reference_time)); |
| 292 } | 292 } |
| OLD | NEW |