Home | History | Annotate | Download | only in browser

Lines Matching refs:form

143   explicit TestFormStructure(const FormData& form) : FormStructure(form) {}
187 void AddSeenForm(const FormData& form,
190 FormData empty_form = form;
201 void FormSubmitted(const FormData& form, const TimeTicks& timestamp) {
203 if (!OnFormSubmitted(form, timestamp))
283 // Set up our form data.
284 FormData form;
285 form.name = ASCIIToUTF16("TestForm");
286 form.origin = GURL("http://example.com/form.html");
287 form.action = GURL("http://example.com/submit.html");
288 form.user_submitted = true;
296 form.fields.push_back(field);
303 form.fields.push_back(field);
309 form.fields.push_back(field);
315 form.fields.push_back(field);
321 form.fields.push_back(field);
327 form.fields.push_back(field);
331 // Simulate having seen this form on page load.
332 autofill_manager_->AddSeenForm(form, heuristic_types, server_types);
382 // Simulate form submission.
383 EXPECT_NO_FATAL_FAILURE(autofill_manager_->FormSubmitted(form,
387 // Test that we behave sanely when the cached form differs from the submitted
390 // Set up our form data.
391 FormData form;
392 form.name = ASCIIToUTF16("TestForm");
393 form.origin = GURL("http://example.com/form.html");
394 form.action = GURL("http://example.com/submit.html");
395 form.user_submitted = true;
403 form.fields.push_back(field);
409 form.fields.push_back(field);
415 form.fields.push_back(field);
420 form.fields.push_back(field);
424 // Simulate having seen this form with the desired heuristic and server types.
426 form, heuristic_types, server_types);
429 // Add a field and re-arrange the remaining form fields before submitting.
430 std::vector<FormFieldData> cached_fields = form.fields;
431 form.fields.clear();
434 form.fields.push_back(field);
435 form.fields.push_back(cached_fields[2]);
436 form.fields.push_back(cached_fields[1]);
437 form.fields.push_back(cached_fields[3]);
438 form.fields.push_back(cached_fields[0]);
484 // Simulate form submission.
485 EXPECT_NO_FATAL_FAILURE(autofill_manager_->FormSubmitted(form,
491 // Start with a non-fillable form.
492 FormData form;
493 form.name = ASCIIToUTF16("TestForm");
494 form.origin = GURL("http://example.com/form.html");
495 form.action = GURL("http://example.com/submit.html");
499 form.fields.push_back(field);
501 form.fields.push_back(field);
503 std::vector<FormData> forms(1, form);
505 // Ensure no metrics are logged when loading a non-fillable form.
514 // Add another field to the form, so that it becomes fillable.
518 // Expect only the "form parsed" metric to be logged; no metrics about
534 // Add some fields with an author-specified field type to the form.
535 // We need to add at least three fields, because a form must have at least
538 // local heuristics to detect field types in the rest of the form.
549 // Expect both the "form parsed" metric and the author-specified field type
597 // Test that we log the number of Autofill suggestions when filling a form.
599 // Set up our form data.
600 FormData form;
601 form.name = ASCIIToUTF16("TestForm");
602 form.origin = GURL("http://example.com/form.html");
603 form.action = GURL("http://example.com/submit.html");
604 form.user_submitted = true;
609 form.fields.push_back(field);
612 form.fields.push_back(field);
615 form.fields.push_back(field);
618 // Simulate having seen this form on page load.
620 autofill_manager_->AddSeenForm(form, field_types, field_types);
629 0, form, field, gfx::Rect(), false);
635 0, form, field, gfx::Rect(), false);
639 autofill_manager_->AddSeenForm(form, field_types, field_types);
647 0, form, field, gfx::Rect(), false);
651 autofill_manager_->AddSeenForm(form, field_types, field_types);
658 form.fields[0].is_autofilled = true;
660 0, form, field, gfx::Rect(), false);
663 // Test that we log whether Autofill is enabled when filling a form.
684 // Verify that we correctly log user happiness metrics dealing with form loading
685 // and form submission.
687 // Start with a form with insufficiently many fields.
688 FormData form;
689 form.name = ASCIIToUTF16("TestForm");
690 form.origin = GURL("http://example.com/form.html");
691 form.action = GURL("http://example.com/submit.html");
692 form.user_submitted = true;
696 form.fields.push_back(field);
698 form.fields.push_back(field);
700 std::vector<FormData> forms(1, form);
702 // Expect no notifications when the form is first seen.
710 // Expect no notifications when the form is submitted.
728 autofill_manager_->FormSubmitted(form, TimeTicks::Now());
731 // Add more fields to the form.
733 form.fields.push_back(field);
735 form.fields.push_back(field);
736 forms.front() = form;
738 // Expect a notification when the form is first seen.
745 // Expect a notification when the form is submitted.
750 autofill_manager_->FormSubmitted(form, TimeTicks::Now());
754 form.fields[0].value = ASCIIToUTF16("Elvis Aaron Presley");
755 form.fields[1].value = ASCIIToUTF16("theking@gmail.com");
756 forms.front() = form;
758 // Expect a notification when the form is submitted.
763 autofill_manager_->FormSubmitted(form, TimeTicks::Now());
767 form.fields[2].value = ASCIIToUTF16("12345678901");
768 forms.front() = form;
770 // Expect notifications when the form is submitted.
775 autofill_manager_->FormSubmitted(form, TimeTicks::Now());
780 form.fields[1].is_autofilled = true;
781 forms.front() = form;
783 // Expect notifications when the form is submitted.
788 autofill_manager_->FormSubmitted(form, TimeTicks::Now());
792 form.fields[0].is_autofilled = true;
793 form.fields[2].is_autofilled = true;
794 forms.front() = form;
796 // Expect notifications when the form is submitted.
801 autofill_manager_->FormSubmitted(form, TimeTicks::Now());
805 form.fields[2].value = base::string16();
806 forms.front() = form;
808 // Expect notifications when the form is submitted.
813 autofill_manager_->FormSubmitted(form, TimeTicks::Now());
817 // Verify that we correctly log user happiness metrics dealing with form
820 // Load a fillable form.
821 FormData form;
822 form.name = ASCIIToUTF16("TestForm");
823 form.origin = GURL("http://example.com/form.html");
824 form.action = GURL("http://example.com/submit.html");
825 form.user_submitted = true;
829 form.fields.push_back(field);
831 form.fields.push_back(field);
833 form.fields.push_back(field);
835 std::vector<FormData> forms(1, form);
837 // Expect a notification when the form is first seen.
848 autofill_manager_->OnTextFieldDidChange(form, form.fields.front(),
898 0, form, form.fields.front(),
900 autofill_manager_->OnTextFieldDidChange(form, form.fields.front(),
903 autofill_manager_->OnTextFieldDidChange(form, form.fields.front(),
920 autofill_manager_->OnTextFieldDidChange(form, form.fields[1], TimeTicks());
924 // Verify that we correctly log metrics tracking the duration of form fill.
926 // Load a fillable form.
927 FormData form;
928 form.name = ASCIIToUTF16("TestForm");
929 form.origin = GURL("http://example.com/form.html");
930 form.action = GURL("http://example.com/submit.html");
931 form.user_submitted = true;
935 form.fields.push_back(field);
937 form.fields.push_back(field);
939 form.fields.push_back(field);
941 std::vector<FormData> forms(1, form);
943 // Fill additional form.
944 FormData second_form = form;
950 // Fill the field values for form submission.
951 form.fields[0].value = ASCIIToUTF16("Elvis Aaron Presley");
952 form.fields[1].value = ASCIIToUTF16("theking@gmail.com");
953 form.fields[2].value = ASCIIToUTF16("12345678901");
955 // Fill the field values for form submission.
961 // Expect only form load metrics to be logged if the form is submitted without
974 autofill_manager_->FormSubmitted(form, TimeTicks::FromInternalValue(17));
979 // Expect metric to be logged if the user manually edited a form field.
992 autofill_manager_->OnTextFieldDidChange(form, form.fields.front(),
994 autofill_manager_->FormSubmitted(form, TimeTicks::FromInternalValue(17));
999 // Expect metric to be logged if the user autofilled the form.
1000 form.fields[0].is_autofilled = true;
1015 autofill_manager_->FormSubmitted(form, TimeTicks::FromInternalValue(17));
1037 autofill_manager_->OnTextFieldDidChange(form, form.fields.front(),
1039 autofill_manager_->FormSubmitted(form, TimeTicks::FromInternalValue(17));
1044 // Make sure that loading another form doesn't affect metrics from the first
1045 // form.
1062 autofill_manager_->OnTextFieldDidChange(form, form.fields.front(),
1064 autofill_manager_->FormSubmitted(form, TimeTicks::FromInternalValue(17));
1069 // Make sure that submitting a form that was loaded later will report the