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

Unified Diff: chrome/test/data/password/between_parsing_and_rendering.html

Issue 343663002: PasswordManager: Add rendered forms to pending_login_managers_ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/password/between_parsing_and_rendering.html
diff --git a/chrome/test/data/password/between_parsing_and_rendering.html b/chrome/test/data/password/between_parsing_and_rendering.html
new file mode 100644
index 0000000000000000000000000000000000000000..0be8473802e196f4e1b8d30d14f81eb03668ff48
--- /dev/null
+++ b/chrome/test/data/password/between_parsing_and_rendering.html
@@ -0,0 +1,93 @@
+<!--
+This page enables to simulate the following scenario:
+Once a page body, but not the entire frame, is loaded, a
+password form is dynamically created and added to the page
+body.
+
+Three main points to note:
+1. The form only gets created after the body loads. Therefore
+ the form is not registered during form parsing stage
+ (as in PasswordManager::OnPasswordFormsParsed).
+2. The form gets created before the rendering stage, so it gets
+ registered during PasswordManager::OnPasswordFormsRendered.
+3. The form gets created before the main frame loads. Therefore
+ the form is not registered during OnDynamicFormsSeen.
+
+To make sure the frame loads after the form creation, this page
Garrett Casto 2014/06/19 00:05:40 I think that this comment isn't quite accurate. I
vabr (Chromium) 2014/06/20 07:55:07 Agreed. I tried to amend the comment.
+contains a strange stylesheet, distilled from a much bigger stylesheet
+included in the current live.com website (that's where
+http://crbug.com/367768 was demonstrated). The style uses
+some webkit-only rules for background properties.
+-->
+<html>
+ <head>
+ <script>
+function createForm() {
+ var form = document.createElement('form');
+ form.setAttribute('action', 'done.html');
+
+ var username_label = document.createElement('label');
+ username_label.setAttribute('for', 'username');
+ username_label.innerText = 'Username: ';
+ var username = document.createElement('input');
+ username.type = 'text';
+ username.name = 'username';
+ username.id = 'username';
+
+ var password_label = document.createElement('label');
+ password_label.innerText = 'Password: ';
+ password_label.setAttribute('for', 'password');
+ var password = document.createElement('input');
+ password.type = 'password';
+ password.name = 'password';
+ password.id = 'password';
+
+ var submit = document.createElement('input');
+ submit.type = 'submit';
+ submit.id = 'submit-button';
+ submit.value = 'Submit';
+
+ form.appendChild(username_label);
+ form.appendChild(username);
+ form.appendChild(password_label);
+ form.appendChild(password);
+ form.appendChild(submit);
+
+ return form;
+}
+
+function addForm(form) {
+ document.getElementsByTagName('body')[0].appendChild(form);
+}
+
+function onLoadHandler() {
+ addForm(createForm());
+}
+ </script>
+ <style>
+::-webkit-scrollbar{
+ background-color:#abc;
+}
+::-webkit-scrollbar:disabled{
+ background-color:#abc
+}
+::-webkit-scrollbar-button{
+ background-color:#abc;
+ background-image:url(nonexistent_image.png);
+}
+::-webkit-scrollbar-button:hover{
+ background-color:#abc
+}
+::-webkit-scrollbar-button:active{
+ background-color:#abc
+}
+::-webkit-scrollbar-button:disabled{
+ background-color:#abc
+}
+ </style>
+ <title>Test dynamically created password form</title>
+ </head>
+ <body onload="onLoadHandler();">
+This page is not empty.
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698