Index: chrome/test/data/password/form_utils.js |
diff --git a/chrome/test/data/password/form_utils.js b/chrome/test/data/password/form_utils.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..12a6577531d1850374a969bb23749bc921f8b575 |
--- /dev/null |
+++ b/chrome/test/data/password/form_utils.js |
@@ -0,0 +1,45 @@ |
+// Copyright (c) 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+// Creates the following form: |
+// <form action="done.html"> |
+// <label for="username">Username</label> |
+// <input type="text" id="username" name="username"> |
+// <label for="password">Password</label> |
+// <input type="password" id="password" name="password"> |
+// <input type="submit" id="submit-button"> |
+// </form> |
+function createSimplePasswordForm() { |
+ var form = document.createElement('form'); |
+ form.setAttribute('action', 'done.html'); |
+ |
+ var username_label = document.createElement('label'); |
+ username_label.htmlFor = '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.htmlFor = '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; |
+} |