Lines Matching refs:form

26 PasswordStoreChangeList AddChangeForForm(const PasswordForm& form) {
29 form));
32 PasswordStoreChangeList UpdateChangeForForm(const PasswordForm& form) {
34 PasswordStoreChange::UPDATE, form));
66 // Simple non-html auth form.
75 // Simple password form.
122 // Example password form.
123 PasswordForm form;
124 form.origin = GURL("http://accounts.google.com/LoginAuth");
125 form.action = GURL("http://accounts.google.com/Login");
126 form.username_element = ASCIIToUTF16("Email");
127 form.username_value = ASCIIToUTF16("test@gmail.com");
128 form.password_element = ASCIIToUTF16("Passwd");
129 form.password_value = ASCIIToUTF16("test");
130 form.submit_element = ASCIIToUTF16("signIn");
131 form.signon_realm = "http://www.google.com/";
132 form.ssl_valid = false;
133 form.preferred = false;
134 form.scheme = PasswordForm::SCHEME_HTML;
135 form.times_used = 1;
136 form.form_data.name = ASCIIToUTF16("form_name");
137 form.form_data.method = ASCIIToUTF16("POST");
138 form.date_synced = base::Time::Now();
142 EXPECT_EQ(AddChangeForForm(form), db_.AddLogin(form));
145 FormsAreEqual(form, *result[0]);
150 EXPECT_TRUE(db_.GetLogins(form, &result));
152 FormsAreEqual(form, *result[0]);
157 PasswordForm form2(form);
201 EXPECT_TRUE(db_.RemoveLogin(form));
207 // The old form wont match the new site (http vs https).
208 EXPECT_TRUE(db_.GetLogins(form, &result));
228 // old form, and there is only one record.
264 // Example password form.
265 PasswordForm form;
266 form.origin = GURL("https://foo.com/");
267 form.action = GURL("https://foo.com/login");
268 form.username_element = ASCIIToUTF16("username");
269 form.username_value = ASCIIToUTF16("test@gmail.com");
270 form.password_element = ASCIIToUTF16("password");
271 form.password_value = ASCIIToUTF16("test");
272 form.submit_element = ASCIIToUTF16("");
273 form.signon_realm = "https://foo.com/";
274 form.ssl_valid = true;
275 form.preferred = false;
276 form.scheme = PasswordForm::SCHEME_HTML;
279 EXPECT_EQ(AddChangeForForm(form), db_.AddLogin(form));
286 EXPECT_TRUE(db_.GetLogins(form, &result));
292 PasswordForm form2(form);
322 // Example password form.
323 PasswordForm form;
324 form.origin = GURL("https://accounts.google.com/");
325 form.action = GURL("https://accounts.google.com/login");
326 form.username_element = ASCIIToUTF16("username");
327 form.username_value = ASCIIToUTF16("test@gmail.com");
328 form.password_element = ASCIIToUTF16("password");
329 form.password_value = ASCIIToUTF16("test");
330 form.submit_element = ASCIIToUTF16("");
331 form.signon_realm = "https://accounts.google.com/";
332 form.ssl_valid = true;
333 form.preferred = false;
334 form.scheme = PasswordForm::SCHEME_HTML;
337 EXPECT_EQ(AddChangeForForm(form), db_.AddLogin(form));
344 EXPECT_TRUE(db_.GetLogins(form, &result));
350 PasswordForm form2(form);
372 // Example password form.
373 PasswordForm form;
374 form.origin = GURL("https://foo.com/");
375 form.action = GURL("https://foo.com/login");
376 form.username_element = ASCIIToUTF16("username");
377 form.username_value = ASCIIToUTF16("test@gmail.com");
378 form.password_element = ASCIIToUTF16("password");
379 form.password_value = ASCIIToUTF16("test");
380 form.submit_element = ASCIIToUTF16("");
381 form.signon_realm = "https://foo.com/";
382 form.ssl_valid = true;
383 form.preferred = false;
384 form.scheme = PasswordForm::SCHEME_HTML;
387 EXPECT_EQ(AddChangeForForm(form), db_.AddLogin(form));
394 EXPECT_TRUE(db_.GetLogins(form, &result));
400 PasswordForm form2(form);
414 form.origin = GURL("https://baz.com/login/");
415 form.action = GURL("https://baz.com/login/");
416 form.username_element = ASCIIToUTF16("email");
417 form.username_value = ASCIIToUTF16("test@gmail.com");
418 form.password_element = ASCIIToUTF16("password");
419 form.password_value = ASCIIToUTF16("test");
420 form.submit_element = ASCIIToUTF16("");
421 form.signon_realm = "https://baz.com/";
422 form.ssl_valid = true;
423 form.preferred = false;
424 form.scheme = PasswordForm::SCHEME_HTML;
427 EXPECT_EQ(AddChangeForForm(form), db_.AddLogin(form));
435 PasswordForm form3(form);
449 PasswordForm GetFormWithNewSignonRealm(PasswordForm form,
451 PasswordForm form2(form);
466 // Example password form.
467 PasswordForm form;
468 form.origin = GURL("http://foo.com/");
469 form.action = GURL("http://foo.com/login");
470 form.username_element = ASCIIToUTF16("username");
471 form.username_value = ASCIIToUTF16("test@gmail.com");
472 form.password_element = ASCIIToUTF16("password");
473 form.password_value = ASCIIToUTF16("test");
474 form.submit_element = ASCIIToUTF16("");
475 form.signon_realm = "http://foo.com/";
476 form.ssl_valid = false;
477 form.preferred = false;
478 form.scheme = PasswordForm::SCHEME_HTML;
481 EXPECT_EQ(AddChangeForForm(form), db_.AddLogin(form));
487 // Example password form that has - in the domain name.
489 GetFormWithNewSignonRealm(form, "http://www.foo-bar.com/");
500 EXPECT_TRUE(db_.GetLogins(form, &result));
506 PasswordForm form2 = GetFormWithNewSignonRealm(form, "http://www.foo.com/");
513 form2 = GetFormWithNewSignonRealm(form, "http://a.b.foo.com/");
520 form2 = GetFormWithNewSignonRealm(form, "http://a-b.foo.com/");
527 form2 = GetFormWithNewSignonRealm(form, "http://foo-bar.com/");
534 form2 = GetFormWithNewSignonRealm(form, "http://www.foo-bar.com/");
541 form2 = GetFormWithNewSignonRealm(form, "http://a.b.foo-bar.com/");
548 form2 = GetFormWithNewSignonRealm(form, "http://a-b.foo-bar.com/");
555 form2 = GetFormWithNewSignonRealm(form, "http://foo.com:1337/");
560 form2 = GetFormWithNewSignonRealm(form, "https://foo.com/");
565 form2 = GetFormWithNewSignonRealm(form, "http://notfoo.com/");
570 form2 = GetFormWithNewSignonRealm(form, "http://baz.com/");
575 form2 = GetFormWithNewSignonRealm(form, "http://foo-baz.com/");
585 // Example password form.
586 PasswordForm form;
587 form.origin = GURL(url + std::string("/LoginAuth"));
588 form.username_element = ASCIIToUTF16(unique_string);
589 form.username_value = ASCIIToUTF16(unique_string);
590 form.password_element = ASCIIToUTF16(unique_string);
591 form.submit_element = ASCIIToUTF16("signIn");
592 form.signon_realm = url;
594 form.date_created = time;
596 form.date_synced = time;
597 return db->AddLogin(form) == AddChangeForForm(form);
700 // Save a form as blacklisted.
701 PasswordForm form;
702 form.origin = GURL("http://accounts.google.com/LoginAuth");
703 form.action = GURL("http://accounts.google.com/Login");
704 form.username_element = ASCIIToUTF16("Email");
705 form.password_element = ASCIIToUTF16("Passwd");
706 form.submit_element = ASCIIToUTF16("signIn");
707 form.signon_realm = "http://www.google.com/";
708 form.ssl_valid = false;
709 form.preferred = true;
710 form.blacklisted_by_user = true;
711 form.scheme = PasswordForm::SCHEME_HTML;
712 form.date_synced = base::Time::Now();
713 EXPECT_EQ(AddChangeForForm(form), db_.AddLogin(form));
720 EXPECT_TRUE(db_.GetLogins(form, &result));
722 FormsAreEqual(form, *result[0]);
728 FormsAreEqual(form, *result[0]);
755 // Save an incomplete form. Note that it only has a few fields set, ex. it's
770 // A form on some website. It should trigger a match with the stored one.
797 // in this particular form on the page.
804 // Let's say this login form worked. Now update the stored credentials with
806 // the encountered form.
829 // Save an incomplete form. Note that it only has a few fields set, ex. it's
844 // Save a complete version of the previous form. Both forms could exist if
885 PasswordForm form;
886 form.origin = GURL("http://accounts.google.com/LoginAuth");
887 form.signon_realm = "http://accounts.google.com/";
888 form.username_value = ASCIIToUTF16("my_username");
889 form.password_value = ASCIIToUTF16("my_password");
890 form.ssl_valid = false;
891 form.preferred = true;
892 form.blacklisted_by_user = false;
893 form.scheme = PasswordForm::SCHEME_HTML;
894 EXPECT_EQ(AddChangeForForm(form), db_.AddLogin(form));
896 // Add almost the same form again.
897 form.times_used++;
899 list.push_back(PasswordStoreChange(PasswordStoreChange::REMOVE, form));
900 list.push_back(PasswordStoreChange(PasswordStoreChange::ADD, form));
901 EXPECT_EQ(list, db_.AddLogin(form));