Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Firefox/widget/tests/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 5 kB image not shown  

SSL test_secure_input.html   Interaktion und
PortierbarkeitHTML

 
 products/sources/formale Sprachen/C/Firefox/widget/tests/test_secure_input.html


<!DOCTYPE html>
<html>
<head>
  <title>Test for secure input mode</title>
  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
  <script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
  <script src="chrome://mochikit/content/tests/SimpleTest/NativeKeyCodes.js"></script>
  <link rel="stylesheet" type="text/css"
          href="chrome://mochikit/content/tests/SimpleTest/test.css" />
</head>
<body>
<div id="content" style="display: none">
  
</div>
<pre id="test">
</pre>

<p>
  <input id="input_text" type="text"><br>
  <input id="input_password" type="password"><br>
  <input id="input_text_readonly" type="text" readonly><br>
  <input id="input_text_ime_mode_disabled" type="text" style="ime-mode: disabled;"><br>
  <input id="input_change" type="text"><br>
  <textarea id="textarea"></textarea><br>
</p>
<div id="contenteditable" contenteditable style="min-height: 3em;"></div>

<script class="testbody" type="application/javascript">

  SimpleTest.waitForExplicitFinish();

  function sendAKeyEvent() {
    synthesizeNativeKey(KEYBOARD_LAYOUT_EN_US, MAC_VK_ANSI_A, {}, "a""a");
  }

  function isFocused(aElement) {
    return (SpecialPowers.focusManager.focusedElement == aElement);
  }

  function runTest() {
    sendAKeyEvent();
    ok(true, "Not crashed: input on the document");
    $("input_text").focus();
    sendAKeyEvent();
    ok(true, "Not crashed: input on text\">");
    $("input_password").focus();
    sendAKeyEvent();
    ok(true, "Not crashed: input on password\">");
    $("input_password").blur();
    sendAKeyEvent();
    ok(true, "Not crashed: input on the document after blur() of password\">");
    $("input_password").focus();
    $("input_text_readonly").focus();
    sendAKeyEvent();
    ok(true, "Not crashed: input on text\" readonly>");
    $("input_password").focus();
    $("input_text_ime_mode_disabled").focus();
    sendAKeyEvent();
    ok(true, "Not crashed: input on text\" style=\"ime-mode: disabled;\">");
    $("input_password").focus();
    $("textarea").focus();
    sendAKeyEvent();
    ok(true, "Not crashed: input on