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

Side by Side Diff: chrome/browser/safe_browsing/ui_manager_unittest.cc

Issue 2275123004: Downgrade security state while displaying an SB interstitial (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dangerstate
Patch Set: Moar bugfix (thanks trybots!!) Created 4 years, 3 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
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 "chrome/browser/safe_browsing/ui_manager.h" 5 #include "chrome/browser/safe_browsing/ui_manager.h"
6 6
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "chrome/browser/safe_browsing/safe_browsing_service.h" 8 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
9 #include "chrome/browser/safe_browsing/ui_manager.h" 9 #include "chrome/browser/safe_browsing/ui_manager.h"
10 #include "chrome/test/base/chrome_render_view_host_test_harness.h" 10 #include "chrome/test/base/chrome_render_view_host_test_harness.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 ChromeRenderViewHostTestHarness::SetUp(); 72 ChromeRenderViewHostTestHarness::SetUp();
73 } 73 }
74 74
75 void TearDown() override { ChromeRenderViewHostTestHarness::TearDown(); } 75 void TearDown() override { ChromeRenderViewHostTestHarness::TearDown(); }
76 76
77 bool IsWhitelisted(SafeBrowsingUIManager::UnsafeResource resource) { 77 bool IsWhitelisted(SafeBrowsingUIManager::UnsafeResource resource) {
78 return ui_manager_->IsWhitelisted(resource); 78 return ui_manager_->IsWhitelisted(resource);
79 } 79 }
80 80
81 void AddToWhitelist(SafeBrowsingUIManager::UnsafeResource resource) { 81 void AddToWhitelist(SafeBrowsingUIManager::UnsafeResource resource) {
82 ui_manager_->AddToWhitelist(resource); 82 ui_manager_->AddToWhitelistUrlSet(resource, false);
83 } 83 }
84 84
85 SafeBrowsingUIManager::UnsafeResource MakeUnsafeResource( 85 SafeBrowsingUIManager::UnsafeResource MakeUnsafeResource(
86 const char* url, 86 const char* url,
87 bool is_subresource) { 87 bool is_subresource) {
88 SafeBrowsingUIManager::UnsafeResource resource; 88 SafeBrowsingUIManager::UnsafeResource resource;
89 resource.url = GURL(url); 89 resource.url = GURL(url);
90 resource.is_subresource = is_subresource; 90 resource.is_subresource = is_subresource;
91 resource.web_contents_getter = 91 resource.web_contents_getter =
92 SafeBrowsingUIManager::UnsafeResource::GetWebContentsGetter( 92 SafeBrowsingUIManager::UnsafeResource::GetWebContentsGetter(
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 std::vector<SafeBrowsingUIManager::UnsafeResource> resources; 265 std::vector<SafeBrowsingUIManager::UnsafeResource> resources;
266 resources.push_back(resource); 266 resources.push_back(resource);
267 SimulateBlockingPageDone(resources, false); 267 SimulateBlockingPageDone(resources, false);
268 EXPECT_FALSE(IsWhitelisted(resource)); 268 EXPECT_FALSE(IsWhitelisted(resource));
269 waiter.WaitForCallback(); 269 waiter.WaitForCallback();
270 EXPECT_TRUE(waiter.callback_called()); 270 EXPECT_TRUE(waiter.callback_called());
271 EXPECT_FALSE(waiter.proceed()); 271 EXPECT_FALSE(waiter.proceed());
272 } 272 }
273 273
274 } // namespace safe_browsing 274 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/ui_manager.cc ('k') | chrome/browser/ssl/chrome_security_state_model_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698