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

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

Issue 2669013002: Convert ClientSideDetectionHost to use the new navigation callbacks. (Closed)
Patch Set: fix unittests Created 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/safe_browsing/client_side_detection_host_unittest.cc
diff --git a/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc b/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc
index 5ca8bf291dbb650cf09886780269c904d3691c8c..79015e7e8b03a3efee39beb8ce2690a16b511d51 100644
--- a/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc
+++ b/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc
@@ -222,6 +222,7 @@ class ClientSideDetectionHostTest : public ChromeRenderViewHostTestHarness {
// We need to create this here since we don't call DidStopLanding in
// this test.
csd_host_->browse_info_.reset(new BrowseInfo);
+ ClientSideDetectionHost::IgnoreMimeTypeCheckForTesting(true);
}
void TearDown() override {
@@ -233,6 +234,7 @@ class ClientSideDetectionHostTest : public ChromeRenderViewHostTestHarness {
ui_manager_ = NULL;
base::RunLoop().RunUntilIdle();
ChromeRenderViewHostTestHarness::TearDown();
+ ClientSideDetectionHost::IgnoreMimeTypeCheckForTesting(false);
}
content::BrowserContext* CreateBrowserContext() override {
@@ -1033,6 +1035,7 @@ TEST_F(ClientSideDetectionHostTest, TestPreClassificationCheckMimeType) {
// Note: for this test to work correctly, the new URL must be on the
// same domain as the previous URL, otherwise it will create a new
// RenderFrameHost that won't have the mime type set.
+ ClientSideDetectionHost::IgnoreMimeTypeCheckForTesting(false);
GURL url("http://host2.com/image.jpg");
RenderFrameHostTester::For(web_contents()->GetMainFrame())->
SetContentsMimeType("image/jpeg");
@@ -1043,6 +1046,7 @@ TEST_F(ClientSideDetectionHostTest, TestPreClassificationCheckMimeType) {
ExpectStartPhishingDetection(NULL);
ExpectShouldClassifyForMalwareResult(true);
+ ClientSideDetectionHost::IgnoreMimeTypeCheckForTesting(true);
}
TEST_F(ClientSideDetectionHostTest,

Powered by Google App Engine
This is Rietveld 408576698