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 "chrome/renderer/safe_browsing/phishing_classifier_delegate.h" | 5 #include "chrome/renderer/safe_browsing/phishing_classifier_delegate.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 EXPECT_CALL(*classifier_, CancelPendingClassification()); | 560 EXPECT_CALL(*classifier_, CancelPendingClassification()); |
561 EXPECT_CALL(*classifier_, BeginClassification(Pointee(page_text), _)); | 561 EXPECT_CALL(*classifier_, BeginClassification(Pointee(page_text), _)); |
562 PageCaptured(&page_text, false); | 562 PageCaptured(&page_text, false); |
563 Mock::VerifyAndClearExpectations(classifier_); | 563 Mock::VerifyAndClearExpectations(classifier_); |
564 } | 564 } |
565 | 565 |
566 // The delegate will cancel pending classification on destruction. | 566 // The delegate will cancel pending classification on destruction. |
567 EXPECT_CALL(*classifier_, CancelPendingClassification()); | 567 EXPECT_CALL(*classifier_, CancelPendingClassification()); |
568 } | 568 } |
569 | 569 |
570 #if defined(ADDERSS_SANITIZER) | 570 #if defined(ADDRESS_SANITIZER) |
571 #define Maybe_DuplicatePageCapture DISABLED_DuplicatePageCapture | 571 #define Maybe_DuplicatePageCapture DISABLED_DuplicatePageCapture |
572 #else | 572 #else |
573 #define Maybe_DuplicatePageCapture DuplicatePageCapture | 573 #define Maybe_DuplicatePageCapture DuplicatePageCapture |
574 #endif | 574 #endif |
575 IN_PROC_BROWSER_TEST_F(PhishingClassifierDelegateTest, | 575 IN_PROC_BROWSER_TEST_F(PhishingClassifierDelegateTest, |
576 Maybe_DuplicatePageCapture) { | 576 Maybe_DuplicatePageCapture) { |
577 // Tests that a second PageCaptured notification causes classification to | 577 // Tests that a second PageCaptured notification causes classification to |
578 // be cancelled. | 578 // be cancelled. |
579 MockScorer scorer; | 579 MockScorer scorer; |
580 delegate_->SetPhishingScorer(&scorer); | 580 delegate_->SetPhishingScorer(&scorer); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 RunClassificationDone(verdict); | 631 RunClassificationDone(verdict); |
632 ASSERT_TRUE(intercepting_filter_->verdict()); | 632 ASSERT_TRUE(intercepting_filter_->verdict()); |
633 EXPECT_EQ(verdict.SerializeAsString(), | 633 EXPECT_EQ(verdict.SerializeAsString(), |
634 intercepting_filter_->verdict()->SerializeAsString()); | 634 intercepting_filter_->verdict()->SerializeAsString()); |
635 | 635 |
636 // The delegate will cancel pending classification on destruction. | 636 // The delegate will cancel pending classification on destruction. |
637 EXPECT_CALL(*classifier_, CancelPendingClassification()); | 637 EXPECT_CALL(*classifier_, CancelPendingClassification()); |
638 } | 638 } |
639 | 639 |
640 } // namespace safe_browsing | 640 } // namespace safe_browsing |
OLD | NEW |