Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/dom/html/test/forms/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  test_submit_invalid_file.html   Sprache: HTML

 
 products/Sources/formale Sprachen/C/Firefox/dom/html/test/forms/test_submit_invalid_file.html


<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=702949
-->

<head>
  <meta charset="utf-8">
  <title>Test invalid file submission</title>
  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=702949">Mozilla Bug 702949</a>
<p id="display"></p>
<div id="content" style="display: none">
  <form action='http://mochi.test:8888/chrome/dom/html/test/forms/submit_invalid_file.sjs' method='post' target='result'
        enctype='multipart/form-data'>
    <input type='file' name='file'>
  </form>
  <iframe name='result'></iframe>
</div>
<pre id="test">
</pre>
<script type="application/javascript">
  /*
   * Test invalid file submission by submitting a file that has been deleted
   * from the file system before the form has been submitted.
   * The form submission triggers a sjs file that shows its output in a frame.
   * That means the test might time out if it fails.
   */

  SimpleTest.waitForExplicitFinish();
  addLoadEvent(function() {
    var { FileUtils } = SpecialPowers.ChromeUtils.importESModule(
      "resource://gre/modules/FileUtils.sys.mjs"
    );

    var i = document.getElementsByTagName('input')[0];

    var file = FileUtils.getDir("TmpD", []);
    file.append("testfile");
    file.createUnique(SpecialPowers.Ci.nsIFile.NORMAL_FILE_TYPE, 0o644);

    SpecialPowers.wrap(i).value = file.path;
    file.remove(/* recursive = */ false);

    document.getElementsByName('result')[0].addEventListener('load', function() {
      is(window.frames[0].document.body.textContent, "SUCCESS");
      SimpleTest.finish();
    });
    document.forms[0].submit();
  });
</script>
</body>
</html>

Messung V0.5
C=99 H=100 G=99

¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.