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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 EXPECT_FALSE(PasswordProtectionService::CanGetReputationOfURL( | 424 EXPECT_FALSE(PasswordProtectionService::CanGetReputationOfURL( |
425 GURL("http://127.0.0.1"))); | 425 GURL("http://127.0.0.1"))); |
426 | 426 |
427 // Main frame URL is a private IP address or anything in an IANA-reserved | 427 // Main frame URL is a private IP address or anything in an IANA-reserved |
428 // range. | 428 // range. |
429 EXPECT_FALSE(PasswordProtectionService::CanGetReputationOfURL( | 429 EXPECT_FALSE(PasswordProtectionService::CanGetReputationOfURL( |
430 GURL("http://192.168.1.0/"))); | 430 GURL("http://192.168.1.0/"))); |
431 EXPECT_FALSE(PasswordProtectionService::CanGetReputationOfURL( | 431 EXPECT_FALSE(PasswordProtectionService::CanGetReputationOfURL( |
432 GURL("http://10.0.1.0/"))); | 432 GURL("http://10.0.1.0/"))); |
433 EXPECT_FALSE(PasswordProtectionService::CanGetReputationOfURL( | 433 EXPECT_FALSE(PasswordProtectionService::CanGetReputationOfURL( |
434 GURL("http://FEED::BEEF"))); | 434 GURL("http://[FEED::BEEF]"))); |
435 | 435 |
436 // Main frame URL is a no-yet-assigned y ICANN gTLD. | 436 // Main frame URL is a no-yet-assigned y ICANN gTLD. |
437 EXPECT_FALSE(PasswordProtectionService::CanGetReputationOfURL( | 437 EXPECT_FALSE(PasswordProtectionService::CanGetReputationOfURL( |
438 GURL("http://intranet"))); | 438 GURL("http://intranet"))); |
439 EXPECT_FALSE(PasswordProtectionService::CanGetReputationOfURL( | 439 EXPECT_FALSE(PasswordProtectionService::CanGetReputationOfURL( |
440 GURL("http://host.intranet.example"))); | 440 GURL("http://host.intranet.example"))); |
441 | 441 |
442 // Main frame URL is a dotless domain. | 442 // Main frame URL is a dotless domain. |
443 EXPECT_FALSE(PasswordProtectionService::CanGetReputationOfURL( | 443 EXPECT_FALSE(PasswordProtectionService::CanGetReputationOfURL( |
444 GURL("http://go/example"))); | 444 GURL("http://go/example"))); |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 request_->OnURLFetchComplete(&fetcher); | 673 request_->OnURLFetchComplete(&fetcher); |
674 base::RunLoop().RunUntilIdle(); | 674 base::RunLoop().RunUntilIdle(); |
675 | 675 |
676 actual_request = password_protection_service_->GetLatestRequestProto(); | 676 actual_request = password_protection_service_->GetLatestRequestProto(); |
677 ASSERT_TRUE(actual_request->has_password_reuse_event()); | 677 ASSERT_TRUE(actual_request->has_password_reuse_event()); |
678 ASSERT_FALSE( | 678 ASSERT_FALSE( |
679 actual_request->password_reuse_event().is_chrome_signin_password()); | 679 actual_request->password_reuse_event().is_chrome_signin_password()); |
680 } | 680 } |
681 | 681 |
682 } // namespace safe_browsing | 682 } // namespace safe_browsing |
OLD | NEW |