Chromium Code Reviews| Index: components/autofill/content/browser/content_autofill_driver_unittest.cc |
| diff --git a/components/autofill/content/browser/content_autofill_driver_unittest.cc b/components/autofill/content/browser/content_autofill_driver_unittest.cc |
| index 5feba33619fb3c13f8b24223469341a3b858748e..099e8c165bcefe8d87b02e842753f41b4b17c0f0 100644 |
| --- a/components/autofill/content/browser/content_autofill_driver_unittest.cc |
| +++ b/components/autofill/content/browser/content_autofill_driver_unittest.cc |
| @@ -22,6 +22,8 @@ |
| #include "components/autofill/core/common/form_data_predictions.h" |
| #include "content/public/browser/browser_context.h" |
| #include "content/public/browser/navigation_details.h" |
| +#include "content/public/browser/navigation_entry.h" |
| +#include "content/public/browser/ssl_status.h" |
| #include "content/public/browser/storage_partition.h" |
| #include "content/public/browser/web_contents.h" |
| #include "content/public/common/frame_navigate_params.h" |
| @@ -447,4 +449,33 @@ TEST_F(ContentAutofillDriverTest, PreviewFieldWithValue) { |
| EXPECT_EQ(input_value, output_value); |
| } |
| +// Tests that credit card form interactions are recorded on the current |
| +// NavigationEntry's SSLStatus if the page is HTTP. |
| +TEST_F(ContentAutofillDriverTest, CreditCardFormInteraction) { |
| + GURL url("http://example.test"); |
| + NavigateAndCommit(url); |
| + driver_->DidInteractWithCreditCardForm(); |
| + |
| + content::NavigationEntry* entry = |
| + web_contents()->GetController().GetVisibleEntry(); |
| + ASSERT_TRUE(entry); |
| + EXPECT_EQ(url, entry->GetURL()); |
| + EXPECT_TRUE(!!(entry->GetSSL().content_status & |
| + content::SSLStatus::DISPLAYED_CREDIT_CARD_FIELD_ON_HTTP)); |
| +} |
| +// Tests that credit card form interactions are *not* recorded on the current |
|
vabr (Chromium)
2016/10/18 09:35:23
nit: Please add a blank line above.
estark
2016/10/18 16:34:27
Done.
|
| +// NavigationEntry's SSLStatus if the page is *not* HTTP. |
| +TEST_F(ContentAutofillDriverTest, CreditCardFormInteractionOnHTTPS) { |
| + GURL url("https://example.test"); |
| + NavigateAndCommit(url); |
| + driver_->DidInteractWithCreditCardForm(); |
| + |
| + content::NavigationEntry* entry = |
| + web_contents()->GetController().GetVisibleEntry(); |
| + ASSERT_TRUE(entry); |
| + EXPECT_EQ(url, entry->GetURL()); |
| + EXPECT_FALSE(!!(entry->GetSSL().content_status & |
| + content::SSLStatus::DISPLAYED_CREDIT_CARD_FIELD_ON_HTTP)); |
| +} |
| + |
| } // namespace autofill |