Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(927)

Side by Side Diff: chrome/browser/banners/app_banner_settings_helper_unittest.cc

Issue 932703006: Enforce HTTPS URLs to show app banners. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/android/banners/app_banner_manager.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/android/banners/app_banner_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698