| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/ref_counted.h" | 7 #include "base/ref_counted.h" |
| 8 #include "base/string16.h" | 8 #include "base/string16.h" |
| 9 #include "base/task.h" | 9 #include "base/task.h" |
| 10 #include "chrome/browser/autocomplete_history_manager.h" | 10 #include "chrome/browser/autocomplete_history_manager.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 webkit_glue::FormField invalid_cc(ASCIIToUTF16("Credit Card"), | 77 webkit_glue::FormField invalid_cc(ASCIIToUTF16("Credit Card"), |
| 78 ASCIIToUTF16("ccnum"), | 78 ASCIIToUTF16("ccnum"), |
| 79 ASCIIToUTF16("4580123456789012"), | 79 ASCIIToUTF16("4580123456789012"), |
| 80 ASCIIToUTF16("text"), | 80 ASCIIToUTF16("text"), |
| 81 20); | 81 20); |
| 82 form.fields.push_back(invalid_cc); | 82 form.fields.push_back(invalid_cc); |
| 83 | 83 |
| 84 EXPECT_CALL(*(web_data_service_.get()), AddFormFields(_)).Times(1); | 84 EXPECT_CALL(*(web_data_service_.get()), AddFormFields(_)).Times(1); |
| 85 autocomplete_manager_->FormSubmitted(form); | 85 autocomplete_manager_->FormSubmitted(form); |
| 86 } | 86 } |
| 87 |
| 88 // Tests that SSNs are not sent to the WebDatabase to be saved. |
| 89 TEST_F(AutocompleteHistoryManagerTest, SSNValue) { |
| 90 FormData form; |
| 91 form.name = ASCIIToUTF16("MyForm"); |
| 92 form.method = ASCIIToUTF16("POST"); |
| 93 form.origin = GURL("http://myform.com/form.html"); |
| 94 form.action = GURL("http://myform.com/submit.html"); |
| 95 |
| 96 webkit_glue::FormField ssn(ASCIIToUTF16("Social Security Number"), |
| 97 ASCIIToUTF16("ssn"), |
| 98 ASCIIToUTF16("078-05-1120"), |
| 99 ASCIIToUTF16("text"), |
| 100 20); |
| 101 form.fields.push_back(ssn); |
| 102 |
| 103 EXPECT_CALL(*web_data_service_, AddFormFields(_)).Times(0); |
| 104 autocomplete_manager_->FormSubmitted(form); |
| 105 } |
| OLD | NEW |