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

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

Issue 7172018: Revert 89178 - Create a browser feature extractor that runs after the renderer has (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 6 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
« no previous file with comments | « chrome/browser/safe_browsing/client_side_detection_host.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/client_side_detection_host_unittest.cc
===================================================================
--- chrome/browser/safe_browsing/client_side_detection_host_unittest.cc (revision 89204)
+++ chrome/browser/safe_browsing/client_side_detection_host_unittest.cc (working copy)
@@ -49,11 +49,6 @@
return other.SerializeAsString() == arg.SerializeAsString();
}
-ACTION(QuitUIMessageLoop) {
- EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::UI));
- MessageLoopForUI::current()->Quit();
-}
-
class MockClientSideDetectionService : public ClientSideDetectionService {
public:
explicit MockClientSideDetectionService(const FilePath& model_path)
@@ -103,7 +98,7 @@
};
// Helper function which quits the UI message loop from the IO message loop.
-void QuitUIMessageLoopFromIO() {
+void QuitUIMessageLoop() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
BrowserThread::PostTask(BrowserThread::UI,
FROM_HERE,
@@ -155,7 +150,7 @@
// we put the quit message there.
BrowserThread::PostTask(BrowserThread::IO,
FROM_HERE,
- NewRunnableFunction(&QuitUIMessageLoopFromIO));
+ NewRunnableFunction(&QuitUIMessageLoop));
MessageLoop::current()->Run();
}
@@ -232,9 +227,8 @@
EXPECT_CALL(*csd_service_,
SendClientReportPhishingRequest(Pointee(EqualsProto(verdict)), _))
- .WillOnce(DoAll(DeleteArg<0>(), SaveArg<1>(&cb), QuitUIMessageLoop()));
+ .WillOnce(DoAll(DeleteArg<0>(), SaveArg<1>(&cb)));
OnDetectedPhishingSite(verdict.SerializeAsString());
- MessageLoop::current()->Run();
EXPECT_TRUE(Mock::VerifyAndClear(csd_service_.get()));
ASSERT_TRUE(cb);
@@ -257,9 +251,8 @@
EXPECT_CALL(*csd_service_,
SendClientReportPhishingRequest(Pointee(EqualsProto(verdict)), _))
- .WillOnce(DoAll(DeleteArg<0>(), SaveArg<1>(&cb), QuitUIMessageLoop()));
+ .WillOnce(DoAll(DeleteArg<0>(), SaveArg<1>(&cb)));
OnDetectedPhishingSite(verdict.SerializeAsString());
- MessageLoop::current()->Run();
EXPECT_TRUE(Mock::VerifyAndClear(csd_service_.get()));
ASSERT_TRUE(cb);
@@ -283,9 +276,8 @@
EXPECT_CALL(*csd_service_,
SendClientReportPhishingRequest(Pointee(EqualsProto(verdict)), _))
- .WillOnce(DoAll(DeleteArg<0>(), SaveArg<1>(&cb), QuitUIMessageLoop()));
+ .WillOnce(DoAll(DeleteArg<0>(), SaveArg<1>(&cb)));
OnDetectedPhishingSite(verdict.SerializeAsString());
- MessageLoop::current()->Run();
EXPECT_TRUE(Mock::VerifyAndClear(csd_service_.get()));
ASSERT_TRUE(cb);
@@ -336,9 +328,8 @@
EXPECT_CALL(*csd_service_,
SendClientReportPhishingRequest(Pointee(EqualsProto(verdict)), _))
- .WillOnce(DoAll(DeleteArg<0>(), SaveArg<1>(&cb), QuitUIMessageLoop()));
+ .WillOnce(DoAll(DeleteArg<0>(), SaveArg<1>(&cb)));
OnDetectedPhishingSite(verdict.SerializeAsString());
- MessageLoop::current()->Run();
EXPECT_TRUE(Mock::VerifyAndClear(csd_service_.get()));
ASSERT_TRUE(cb);
GURL other_phishing_url("http://other_phishing_url.com/bla");
@@ -354,11 +345,8 @@
verdict.set_client_score(0.8f);
EXPECT_CALL(*csd_service_,
SendClientReportPhishingRequest(Pointee(EqualsProto(verdict)), _))
- .WillOnce(DoAll(DeleteArg<0>(),
- SaveArg<1>(&cb_other),
- QuitUIMessageLoop()));
+ .WillOnce(DoAll(DeleteArg<0>(), SaveArg<1>(&cb_other)));
OnDetectedPhishingSite(verdict.SerializeAsString());
- MessageLoop::current()->Run();
EXPECT_TRUE(Mock::VerifyAndClear(csd_service_.get()));
ASSERT_TRUE(cb_other);
« no previous file with comments | « chrome/browser/safe_browsing/client_side_detection_host.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698