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

Unified Diff: chrome/browser/safe_browsing/ui_manager_unittest.cc

Issue 2481743009: Expose malware/phishing/etc. distinction from SafeBrowsingUIManager (Closed)
Patch Set: rebase Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/safe_browsing/ui_manager_unittest.cc
diff --git a/chrome/browser/safe_browsing/ui_manager_unittest.cc b/chrome/browser/safe_browsing/ui_manager_unittest.cc
index 9d08f6bfddc4d5a9db0b3bd07d6d822358d8e550..d0dfd2477deade33d410d378a47f41485b402616 100644
--- a/chrome/browser/safe_browsing/ui_manager_unittest.cc
+++ b/chrome/browser/safe_browsing/ui_manager_unittest.cc
@@ -87,7 +87,7 @@ class SafeBrowsingUIManagerTest : public ChromeRenderViewHostTestHarness {
ui_manager_->AddToWhitelistUrlSet(
SafeBrowsingUIManager::GetMainFrameWhitelistUrlForResourceForTesting(
resource),
- web_contents(), false);
+ web_contents(), false, resource.threat_type);
}
SafeBrowsingUIManager::UnsafeResource MakeUnsafeResource(
@@ -148,6 +148,21 @@ TEST_F(SafeBrowsingUIManagerTest, WhitelistIgnoresSitesNotAdded) {
EXPECT_FALSE(IsWhitelisted(resource));
}
+TEST_F(SafeBrowsingUIManagerTest, WhitelistRemembersThreatType) {
+ SafeBrowsingUIManager::UnsafeResource resource =
+ MakeUnsafeResourceAndStartNavigation(kBadURL);
+ AddToWhitelist(resource);
+ EXPECT_TRUE(IsWhitelisted(resource));
+ SBThreatType threat_type;
+ content::NavigationEntry* entry =
+ web_contents()->GetController().GetVisibleEntry();
+ ASSERT_TRUE(entry);
+ EXPECT_TRUE(ui_manager()->IsUrlWhitelistedOrPendingForWebContents(
+ resource.url, resource.is_subresource, entry,
+ resource.web_contents_getter.Run(), true, &threat_type));
+ EXPECT_EQ(resource.threat_type, threat_type);
+}
+
TEST_F(SafeBrowsingUIManagerTest, WhitelistIgnoresPath) {
SafeBrowsingUIManager::UnsafeResource resource =
MakeUnsafeResourceAndStartNavigation(kBadURL);
« 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