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

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

Issue 2451623005: Remove Dangerous indicator after going back from interstitial (Closed)
Patch Set: another typo fix 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
« no previous file with comments | « chrome/browser/safe_browsing/ui_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0807da78315376dfd74f8a4744fffb7607c12ec6..9d08f6bfddc4d5a9db0b3bd07d6d822358d8e550 100644
--- a/chrome/browser/safe_browsing/ui_manager_unittest.cc
+++ b/chrome/browser/safe_browsing/ui_manager_unittest.cc
@@ -12,6 +12,7 @@
#include "chrome/test/base/testing_profile.h"
#include "components/safe_browsing_db/safe_browsing_prefs.h"
#include "components/safe_browsing_db/util.h"
+#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
@@ -73,6 +74,7 @@ class SafeBrowsingUIManagerTest : public ChromeRenderViewHostTestHarness {
void SetUp() override {
SetThreadBundleOptions(content::TestBrowserThreadBundle::REAL_IO_THREAD);
ChromeRenderViewHostTestHarness::SetUp();
+ SafeBrowsingUIManager::CreateWhitelistForTesting(web_contents());
}
void TearDown() override { ChromeRenderViewHostTestHarness::TearDown(); }
@@ -82,7 +84,10 @@ class SafeBrowsingUIManagerTest : public ChromeRenderViewHostTestHarness {
}
void AddToWhitelist(SafeBrowsingUIManager::UnsafeResource resource) {
- ui_manager_->AddToWhitelistUrlSet(resource, false);
+ ui_manager_->AddToWhitelistUrlSet(
+ SafeBrowsingUIManager::GetMainFrameWhitelistUrlForResourceForTesting(
+ resource),
+ web_contents(), false);
}
SafeBrowsingUIManager::UnsafeResource MakeUnsafeResource(
@@ -113,7 +118,14 @@ class SafeBrowsingUIManagerTest : public ChromeRenderViewHostTestHarness {
void SimulateBlockingPageDone(
const std::vector<SafeBrowsingUIManager::UnsafeResource>& resources,
bool proceed) {
- ui_manager_->OnBlockingPageDone(resources, proceed);
+ GURL main_frame_url;
+ content::NavigationEntry* entry =
+ web_contents()->GetController().GetVisibleEntry();
+ if (entry)
+ main_frame_url = entry->GetURL();
+
+ ui_manager_->OnBlockingPageDone(resources, proceed, web_contents(),
+ main_frame_url);
}
protected:
« no previous file with comments | « chrome/browser/safe_browsing/ui_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698