mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 09:45:41 +00:00
7be7b11a1c
This patch is generated by the following sed script: find . ! -wholename '*/.hg*' -type f \( -iname '*.html' -o -iname '*.xhtml' -o -iname '*.xul' -o -iname '*.js' \) -exec sed -i -e 's/\(\(text\|application\)\/javascript\);version=1.[0-9]/\1/g' {} \; MozReview-Commit-ID: AzhtdwJwVNg --HG-- extra : rebase_source : e8f90249454c0779d926f87777f457352961748d
67 lines
1.5 KiB
HTML
67 lines
1.5 KiB
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<title>Test for bug 1319088</title>
|
|
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
|
</head>
|
|
|
|
<body>
|
|
<input id="input" type="file"></input>
|
|
|
|
<script type="application/javascript">
|
|
|
|
function testSetup() {
|
|
SpecialPowers.pushPrefEnv({"set": [["dom.input.dirpicker", true],
|
|
["dom.webkitBlink.dirPicker.enabled", true]]}, next);
|
|
}
|
|
|
|
function populateInputFile() {
|
|
var url = SimpleTest.getTestFileURL("script_fileList.js");
|
|
var script = SpecialPowers.loadChromeScript(url);
|
|
|
|
function onOpened(message) {
|
|
var input = document.getElementById("input");
|
|
SpecialPowers.wrap(input).mozSetFileArray([message.file]);
|
|
|
|
script.destroy();
|
|
next();
|
|
}
|
|
|
|
script.addMessageListener("file.opened", onOpened);
|
|
script.sendAsyncMessage("file.open");
|
|
}
|
|
|
|
function checkBug() {
|
|
var input = document.getElementById("input");
|
|
is(input.files[0].webkitRelativePath, "", "No relative path!");
|
|
|
|
let form = document.createElement('form');
|
|
form.appendChild(input);
|
|
|
|
is(input.files[0].webkitRelativePath, "", "No relative path!");
|
|
SimpleTest.finish();
|
|
}
|
|
|
|
var tests = [
|
|
testSetup,
|
|
populateInputFile,
|
|
checkBug,
|
|
];
|
|
|
|
function next() {
|
|
if (!tests.length) {
|
|
SimpleTest.finish();
|
|
return;
|
|
}
|
|
|
|
var test = tests.shift();
|
|
test();
|
|
}
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
next();
|
|
</script>
|
|
</body>
|
|
</html>
|