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

Side by Side Diff: chrome/renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc

Issue 2013573003: Use EXPECT_FALSE instead of EXPECT_EQ(false to fix linux build with gcc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/renderer/safe_browsing/phishing_classifier_delegate.h" 5 #include "chrome/renderer/safe_browsing/phishing_classifier_delegate.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/common/safe_browsing/csd.pb.h" 10 #include "chrome/common/safe_browsing/csd.pb.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 } 74 }
75 // Return true anyway, since we don't want to block other IPC. 75 // Return true anyway, since we don't want to block other IPC.
76 return true; 76 return true;
77 } 77 }
78 78
79 void VerifyMessageContent(const std::string& verdict_str) { 79 void VerifyMessageContent(const std::string& verdict_str) {
80 ClientPhishingRequest verdict; 80 ClientPhishingRequest verdict;
81 if (verdict.ParseFromString(verdict_str)) { 81 if (verdict.ParseFromString(verdict_str)) {
82 EXPECT_EQ("http://host.com/", verdict.url()); 82 EXPECT_EQ("http://host.com/", verdict.url());
83 EXPECT_EQ(0.8f, verdict.client_score()); 83 EXPECT_EQ(0.8f, verdict.client_score());
84 EXPECT_EQ(false, verdict.is_phishing()); 84 EXPECT_FALSE(verdict.is_phishing());
85 } else { 85 } else {
86 NOTREACHED() << "Cannot parse IPC content. Test failed."; 86 NOTREACHED() << "Cannot parse IPC content. Test failed.";
87 } 87 }
88 } 88 }
89 }; 89 };
90 90
91 class PhishingClassifierDelegateTest : public ChromeRenderViewTest { 91 class PhishingClassifierDelegateTest : public ChromeRenderViewTest {
92 protected: 92 protected:
93 void SetUp() override { 93 void SetUp() override {
94 ChromeUnitTestSuite::InitializeProviders(); 94 ChromeUnitTestSuite::InitializeProviders();
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 verdict.set_url(url.spec()); 496 verdict.set_url(url.spec());
497 verdict.set_client_score(0.8f); 497 verdict.set_client_score(0.8f);
498 verdict.set_is_phishing(false); // Send IPC even if site is not phishing. 498 verdict.set_is_phishing(false); // Send IPC even if site is not phishing.
499 RunAndVerifyClassificationDone(verdict); 499 RunAndVerifyClassificationDone(verdict);
500 500
501 // The delegate will cancel pending classification on destruction. 501 // The delegate will cancel pending classification on destruction.
502 EXPECT_CALL(*classifier_, CancelPendingClassification()); 502 EXPECT_CALL(*classifier_, CancelPendingClassification());
503 } 503 }
504 504
505 } // namespace safe_browsing 505 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « cc/test/ordered_simple_task_runner_unittest.cc ('k') | third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698