Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(348)

Side by Side Diff: chrome/browser/autocomplete_history_manager_unittest.cc

Issue 2853027: Don't save SSNs. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/autocomplete_history_manager.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete_history_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698