| OLD | NEW |
| 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 "base/file_path.h" | 5 #include "base/file_path.h" |
| 6 #include "base/memory/ref_counted.h" | 6 #include "base/memory/ref_counted.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/synchronization/waitable_event.h" | 8 #include "base/synchronization/waitable_event.h" |
| 9 #include "chrome/browser/safe_browsing/browser_feature_extractor.h" | 9 #include "chrome/browser/safe_browsing/browser_feature_extractor.h" |
| 10 #include "chrome/browser/safe_browsing/client_side_detection_host.h" | 10 #include "chrome/browser/safe_browsing/client_side_detection_host.h" |
| (...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 std::vector<GURL> redirect_chain; | 581 std::vector<GURL> redirect_chain; |
| 582 redirect_chain.push_back(url); | 582 redirect_chain.push_back(url); |
| 583 SetRedirectChain(redirect_chain); | 583 SetRedirectChain(redirect_chain); |
| 584 OnPhishingDetectionDone(verdict.SerializeAsString()); | 584 OnPhishingDetectionDone(verdict.SerializeAsString()); |
| 585 MessageLoop::current()->Run(); | 585 MessageLoop::current()->Run(); |
| 586 EXPECT_TRUE(Mock::VerifyAndClear(csd_service_.get())); | 586 EXPECT_TRUE(Mock::VerifyAndClear(csd_service_.get())); |
| 587 } | 587 } |
| 588 | 588 |
| 589 #if defined(OS_WIN) | 589 #if defined(OS_WIN) |
| 590 // Flaky on Windows: crbug.com/134918 | 590 // Flaky on Windows: crbug.com/134918 |
| 591 #define MAYBE_NavigationCancelsShouldClassifyUrl FLAKY_NavigationCancelsShouldCl
assifyUrl | 591 #define MAYBE_NavigationCancelsShouldClassifyUrl DISABLED_NavigationCancelsShoul
dClassifyUrl |
| 592 #else | 592 #else |
| 593 #define MAYBE_NavigationCancelsShouldClassifyUrl NavigationCancelsShouldClassify
Url | 593 #define MAYBE_NavigationCancelsShouldClassifyUrl NavigationCancelsShouldClassify
Url |
| 594 #endif | 594 #endif |
| 595 TEST_F(ClientSideDetectionHostTest, NavigationCancelsShouldClassifyUrl) { | 595 TEST_F(ClientSideDetectionHostTest, NavigationCancelsShouldClassifyUrl) { |
| 596 // Test that canceling pending should classify requests works as expected. | 596 // Test that canceling pending should classify requests works as expected. |
| 597 | 597 |
| 598 GURL first_url("http://first.phishy.url.com"); | 598 GURL first_url("http://first.phishy.url.com"); |
| 599 // The first few checks are done synchronously so check that they have been | 599 // The first few checks are done synchronously so check that they have been |
| 600 // done for the first URL. | 600 // done for the first URL. |
| 601 ExpectPreClassificationChecks(first_url, &kFalse, &kFalse, &kFalse, NULL, | 601 ExpectPreClassificationChecks(first_url, &kFalse, &kFalse, &kFalse, NULL, |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 EXPECT_TRUE(Mock::VerifyAndClear(sb_service_.get())); | 760 EXPECT_TRUE(Mock::VerifyAndClear(sb_service_.get())); |
| 761 EXPECT_EQ(url, resource.url); | 761 EXPECT_EQ(url, resource.url); |
| 762 EXPECT_EQ(url, resource.original_url); | 762 EXPECT_EQ(url, resource.original_url); |
| 763 resource.callback.Reset(); | 763 resource.callback.Reset(); |
| 764 msg = process()->sink().GetFirstMessageMatching( | 764 msg = process()->sink().GetFirstMessageMatching( |
| 765 SafeBrowsingMsg_StartPhishingDetection::ID); | 765 SafeBrowsingMsg_StartPhishingDetection::ID); |
| 766 ASSERT_FALSE(msg); | 766 ASSERT_FALSE(msg); |
| 767 } | 767 } |
| 768 | 768 |
| 769 } // namespace safe_browsing | 769 } // namespace safe_browsing |
| OLD | NEW |