OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <string.h> | 5 #include <string.h> |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "base/test/histogram_tester.h" | 9 #include "base/test/histogram_tester.h" |
10 #include "chrome/test/base/chrome_render_view_test.h" | 10 #include "chrome/test/base/chrome_render_view_test.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 // Sends a message that the |form_index| form on the page is valid for | 48 // Sends a message that the |form_index| form on the page is valid for |
49 // account creation. | 49 // account creation. |
50 void SetAccountCreationFormsDetectedMessage(int form_index) { | 50 void SetAccountCreationFormsDetectedMessage(int form_index) { |
51 WebDocument document = GetMainFrame()->document(); | 51 WebDocument document = GetMainFrame()->document(); |
52 blink::WebVector<blink::WebFormElement> web_forms; | 52 blink::WebVector<blink::WebFormElement> web_forms; |
53 document.forms(web_forms); | 53 document.forms(web_forms); |
54 | 54 |
55 autofill::FormData form_data; | 55 autofill::FormData form_data; |
56 WebFormElementToFormData(web_forms[form_index], | 56 WebFormElementToFormData(web_forms[form_index], |
57 blink::WebFormControlElement(), | 57 blink::WebFormControlElement(), |
58 REQUIRE_NONE, | |
59 EXTRACT_NONE, | 58 EXTRACT_NONE, |
60 &form_data, | 59 &form_data, |
61 NULL /* FormFieldData */); | 60 NULL /* FormFieldData */); |
62 | 61 |
63 std::vector<autofill::FormData> forms; | 62 std::vector<autofill::FormData> forms; |
64 forms.push_back(form_data); | 63 forms.push_back(form_data); |
65 AutofillMsg_AccountCreationFormsDetected msg(0, forms); | 64 AutofillMsg_AccountCreationFormsDetected msg(0, forms); |
66 password_generation_->OnMessageReceived(msg); | 65 password_generation_->OnMessageReceived(msg); |
67 } | 66 } |
68 | 67 |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 | 558 |
560 ExpectPasswordGenerationAvailable("first_password", false); | 559 ExpectPasswordGenerationAvailable("first_password", false); |
561 | 560 |
562 LoadHTMLWithUserGesture(kNewPasswordAutocompleteAttributeFormHTML); | 561 LoadHTMLWithUserGesture(kNewPasswordAutocompleteAttributeFormHTML); |
563 SetNotBlacklistedMessage(kNewPasswordAutocompleteAttributeFormHTML); | 562 SetNotBlacklistedMessage(kNewPasswordAutocompleteAttributeFormHTML); |
564 | 563 |
565 ExpectPasswordGenerationAvailable("first_password", false); | 564 ExpectPasswordGenerationAvailable("first_password", false); |
566 } | 565 } |
567 | 566 |
568 } // namespace autofill | 567 } // namespace autofill |
OLD | NEW |