test_input-manage.html 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <!DOCTYPE HTML>
  2. <html>
  3. <!--
  4. https://bugzilla.mozilla.org/show_bug.cgi?id=920977
  5. -->
  6. <head>
  7. <meta charset="utf-8">
  8. <title>Test for Bug 920977 </title>
  9. <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  10. <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  11. </head>
  12. <body>
  13. <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=920977">Mozilla Bug 920977 </a>
  14. <p id="display"></p>
  15. <div id="content" style="display: none"></div>
  16. <pre id="test">
  17. <script type="application/javascript;version=1.8" src="file_framework.js"></script>
  18. <script type="application/javascript;version=1.8">
  19. function verifier(success, failure) {
  20. try {
  21. if (!this.getObj()) {
  22. failure("Did not receive proper object");
  23. return;
  24. }
  25. } catch (e) {
  26. failure("Received exception!: " + e);
  27. return;
  28. }
  29. try {
  30. this.getObj().removeFocus();
  31. } catch (e) {
  32. failure("Received exception!: " + e);
  33. return;
  34. }
  35. var iframe = document.createElement("iframe");
  36. iframe.setAttribute("mozbrowser", true);
  37. iframe.src = "http://example.org/";
  38. iframe.addEventListener("load", function() {
  39. iframe.removeEventListener("load", arguments.callee);
  40. if (iframe.setInputMethodActive &&
  41. typeof iframe.setInputMethodActive == "function") {
  42. success("Got setInputMethodActive");
  43. } else {
  44. failure("Didn't get setInputMethodActive") ;
  45. }
  46. });
  47. document.getElementById('content').appendChild(iframe);
  48. }
  49. var gData = [
  50. {
  51. perm: ["input-manage", "browser"],
  52. needParentPerm: true,
  53. obj: "mozInputMethod",
  54. webidl: "MozInputMethod",
  55. settings: [["dom.mozInputMethod.enabled", true],
  56. ["dom.mozBrowserFramesEnabled", true],
  57. ["network.disable.ipc.security", true]],
  58. verifier: verifier.toSource()
  59. }
  60. ]
  61. </script>
  62. </pre>
  63. </body>
  64. </html>