toolkit/components/prompts/test/test_bug620145.html
author Justin Dolske <dolske@mozilla.com>
Fri, 07 Jan 2011 19:09:43 -0800
changeset 60232 534adf40eb8b29da66218e32ca34a0096940937e
parent 60229 5e8b96f85355488871c18597d38635801dc2f8c8
child 60233 7b08fef26335b22f23fab430b6938b6f36ec8187
permissions -rw-r--r--
Disable test from bug 620145, as it doesn't seem to work. Patch seems ok, though. a=bustage

<html>
<head>
  <title>Test for Bug 620145</title>
  <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <script type="text/javascript" src="prompt_common.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body onload="runtest()">
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=620145">Mozilla Bug 620145</a>
<pre id="test">
</pre>

<button id="button" onmouseup="alert('message\n');">Button</button>

<script class="testbody" type="text/javascript">
SimpleTest.waitForExplicitFinish();

var testNum = 0;

function runtest()
{
  netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
todo("test disabled, doesn't seem to work.");
SimpleTest.finish();
  isTabModal = true;
  startCallbackTimer();

  var utils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
                getInterface(Components.interfaces.nsIDOMWindowUtils);

  var e = document.createEvent("MouseEvent");
  e.initEvent("mousedown", false, false, window, 0, 1, 1, 1, 1,
              false, false, false, false, 0, null);
  utils.dispatchDOMEventViaPresShell($("button"), e, true);

  e = document.createEvent("MouseEvent");
  e.initEvent("mouseup", false, false, window, 0, 1, 1, 1, 1,
              false, false, false, false, 0, null);
  utils.dispatchDOMEventViaPresShell($("button"), e, true);

  ok(true, "dialog closed");
  SimpleTest.finish();
}

function handleDialog(ui, testNum)
{
  synthesizeMouse(ui.button0, 5, 5, { }, ui.button0.ownerDocument.defaultView);
}
</script>

</body>
</html>