2008-04-10 16:38:45 -07:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Test for Login Manager</title>
|
|
|
|
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
<script type="text/javascript" src="pwmgr_common.js"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
Login Manager test: form with JS submit action
|
2013-08-09 14:56:50 -07:00
|
|
|
<script>
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
var pwmgr = SpecialPowers.Cc["@mozilla.org/login-manager;1"]
|
|
|
|
.getService(SpecialPowers.Ci.nsILoginManager);
|
|
|
|
var jslogin = SpecialPowers.Cc["@mozilla.org/login-manager/loginInfo;1"]
|
|
|
|
.createInstance(SpecialPowers.Ci.nsILoginInfo);
|
|
|
|
jslogin.init("http://mochi.test:8888", "javascript:", null,
|
|
|
|
"jsuser", "jspass123", "uname", "pword");
|
|
|
|
pwmgr.addLogin(jslogin);
|
2008-04-10 16:38:45 -07:00
|
|
|
|
|
|
|
/** Test for Login Manager: JS action URL **/
|
|
|
|
|
|
|
|
function startTest() {
|
|
|
|
checkForm(1, "jsuser", "jspass123");
|
|
|
|
|
|
|
|
pwmgr.removeLogin(jslogin);
|
|
|
|
SimpleTest.finish();
|
|
|
|
}
|
|
|
|
|
2013-08-09 14:56:50 -07:00
|
|
|
window.onload = startTest;
|
|
|
|
</script>
|
2008-04-10 16:38:45 -07:00
|
|
|
|
2013-08-09 14:56:50 -07:00
|
|
|
<p id="display"></p>
|
2008-04-10 16:38:45 -07:00
|
|
|
|
2013-08-09 14:56:50 -07:00
|
|
|
<div id="content" style="display: none">
|
2008-04-10 16:38:45 -07:00
|
|
|
|
|
|
|
|
2013-08-09 14:56:50 -07:00
|
|
|
<form id='form1' action='javascript:alert("never shows")'> 1
|
|
|
|
<input name="uname">
|
|
|
|
<input name="pword" type="password">
|
2008-04-10 16:38:45 -07:00
|
|
|
|
2013-08-09 14:56:50 -07:00
|
|
|
<button type='submit'>Submit</button>
|
|
|
|
<button type='reset'> Reset </button>
|
|
|
|
</form>
|
2008-04-10 16:38:45 -07:00
|
|
|
|
2013-08-09 14:56:50 -07:00
|
|
|
</div>
|
2008-04-10 16:38:45 -07:00
|
|
|
|
2013-08-09 14:56:50 -07:00
|
|
|
<pre id="test"></pre>
|
2008-04-10 16:38:45 -07:00
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
|