OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #include "components/safe_browsing/password_protection/password_protection_servi
ce.h" | 4 #include "components/safe_browsing/password_protection/password_protection_servi
ce.h" |
5 | 5 |
6 #include "base/memory/ptr_util.h" | 6 #include "base/memory/ptr_util.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/test/histogram_tester.h" | 10 #include "base/test/histogram_tester.h" |
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 request_->OnURLFetchComplete(&fetcher); | 623 request_->OnURLFetchComplete(&fetcher); |
624 base::RunLoop().RunUntilIdle(); | 624 base::RunLoop().RunUntilIdle(); |
625 | 625 |
626 LoginReputationClientRequest* actual_request = | 626 LoginReputationClientRequest* actual_request = |
627 password_protection_service_->GetLatestRequestProto(); | 627 password_protection_service_->GetLatestRequestProto(); |
628 EXPECT_EQ(kTargetUrl, actual_request->page_url()); | 628 EXPECT_EQ(kTargetUrl, actual_request->page_url()); |
629 EXPECT_EQ(LoginReputationClientRequest::PASSWORD_REUSE_EVENT, | 629 EXPECT_EQ(LoginReputationClientRequest::PASSWORD_REUSE_EVENT, |
630 actual_request->trigger_type()); | 630 actual_request->trigger_type()); |
631 EXPECT_EQ(1, actual_request->frames_size()); | 631 EXPECT_EQ(1, actual_request->frames_size()); |
632 EXPECT_EQ(kTargetUrl, actual_request->frames(0).url()); | 632 EXPECT_EQ(kTargetUrl, actual_request->frames(0).url()); |
633 ASSERT_TRUE(actual_request->has_password_reuse_event()); | 633 // TODO(jialiul): Update this test when we're ready to fill more fields. |
634 ASSERT_EQ(1, actual_request->password_reuse_event() | 634 ASSERT_FALSE(actual_request->has_password_reuse_event()); |
635 .password_reused_original_origins_size()); | |
636 EXPECT_EQ(kSavedDomain, actual_request->password_reuse_event() | |
637 .password_reused_original_origins(0)); | |
638 } | 635 } |
639 | 636 |
640 } // namespace safe_browsing | 637 } // namespace safe_browsing |
OLD | NEW |