OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser/safe_browsing/download_protection_service.h" | 5 #include "chrome/browser/safe_browsing/download_protection_service.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 | 654 |
655 EXPECT_CALL(*sb_service_, MatchDownloadWhitelistUrl(_)) | 655 EXPECT_CALL(*sb_service_, MatchDownloadWhitelistUrl(_)) |
656 .WillRepeatedly(Return(false)); | 656 .WillRepeatedly(Return(false)); |
657 EXPECT_CALL(*signature_util_, CheckSignature(info.local_file, _)); | 657 EXPECT_CALL(*signature_util_, CheckSignature(info.local_file, _)); |
658 | 658 |
659 download_service_->download_request_timeout_ms_ = 10; | 659 download_service_->download_request_timeout_ms_ = 10; |
660 download_service_->CheckClientDownload( | 660 download_service_->CheckClientDownload( |
661 info, | 661 info, |
662 base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback, | 662 base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback, |
663 base::Unretained(this))); | 663 base::Unretained(this))); |
664 // Run the message loop(s) until SendRequest is called. | |
665 FlushThreadMessageLoops(); | |
666 | 664 |
667 // The request should time out because the HTTP request hasn't returned | 665 // The request should time out because the HTTP request hasn't returned |
668 // anything yet. | 666 // anything yet. |
669 msg_loop_.Run(); | 667 msg_loop_.Run(); |
670 ExpectResult(DownloadProtectionService::SAFE); | 668 ExpectResult(DownloadProtectionService::SAFE); |
671 } | 669 } |
672 } // namespace safe_browsing | 670 } // namespace safe_browsing |
OLD | NEW |