Bug 453873 - fix the TODO in the test for bug 346337; r=dietrich

This commit is contained in:
Simon Bunzli 2008-09-15 18:29:34 +02:00
Родитель be543becfb
Коммит 5d46de8919
3 изменённых файлов: 48 добавлений и 5 удалений

Просмотреть файл

@ -46,6 +46,7 @@ include $(topsrcdir)/config/rules.mk
_BROWSER_TEST_FILES = \
browser_346337.js \
browser_346337_sample.html \
browser_350525.js \
browser_367052.js \
browser_393716.js \

Просмотреть файл

@ -38,15 +38,20 @@ function test() {
/** Test for Bug 346337 **/
let fieldList = {
"//input[@name='testinput']": Date.now().toString(),
"//input[@name='bad name']": Math.random().toString(),
"//input[@name='input']": Date.now().toString(),
"//input[@name='spaced 1']": Math.random().toString(),
"//input[3]": "three",
"//input[@type='checkbox']": true,
"//input[@name='uncheck']": false,
"//input[@type='radio'][1]": false,
"//input[@type='radio'][2]": true,
"//input[@type='radio'][3]": false,
"//select": 2,
"//select[@multiple]": [1, 3],
"//textarea[1]": "",
"//textarea[3]": "Some more test\n" + new Date()
"//textarea[2]": "Some text... " + Math.random(),
"//textarea[3]": "Some more text\n" + new Date(),
"//input[@type='file']": "/dev/null"
};
function getElementByXPath(aTab, aQuery) {
@ -91,8 +96,9 @@ function test() {
let privacy_level = gPrefService.getIntPref("browser.sessionstore.privacy_level");
gPrefService.setIntPref("browser.sessionstore.privacy_level", 2);
todo(false, "test doesn't run from the harness's http server");
let tab = tabbrowser.addTab("https://bugzilla.mozilla.org/attachment.cgi?id=328502");
let testURL = "chrome://mochikit/content/browser/" +
"browser/components/sessionstore/test/browser/browser_346337_sample.html";
let tab = tabbrowser.addTab(testURL);
tab.linkedBrowser.addEventListener("load", function(aEvent) {
for (let xpath in fieldList)
setFormValue(tab, xpath, fieldList[xpath]);

Просмотреть файл

@ -0,0 +1,36 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<title>Test for bug 346337</title>
<h3>Text Fields</h3>
<input type="text" name="input">
<input type="text" name="spaced 1">
<input>
<h3>Checkboxes and Radio buttons</h3>
<input type="checkbox" name="check"> Check 1
<input type="checkbox" name="uncheck" checked> Check 2
<p>
<input type="radio" name="group" value="1"> Radio 1
<input type="radio" name="group" value="some"> Radio 2
<input type="radio" name="group" checked> Radio 3
<h3>Selects</h3>
<select name="any">
<option value="1"> Select 1
<option value="some"> Select 2
<option>Select 3
</select>
<select multiple="multiple">
<option value=1> Multi-select 1
<option value=2> Multi-select 2
<option value=3> Multi-select 3
<option value=4> Multi-select 4
</select>
<h3>Text Areas</h3>
<textarea name="testarea"></textarea>
<textarea name="sized one" rows="5" cols="25"></textarea>
<textarea></textarea>
<h3>File Selector</h3>
<input type="file">