gecko-dev/dom/contacts/tests/test_contacts_events.html

41 lines
1.2 KiB
HTML

<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=764667
-->
<head>
<title>Test for Bug 678695</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=764667">Mozilla Bug 764667</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script type="application/javascript">
/** Test for Bug 764667 **/
SpecialPowers.addPermission("contacts-read", true, document);
var e = new MozContactChangeEvent("contactchanged", {contactID: "123", reason: "create"});
ok(e, "Should have contactsChange event!");
is(e.contactID, "123", "ID should be 123.");
is(e.reason, "create", "Reason should be create.");
e = new MozContactChangeEvent("contactchanged", {contactID: "test", reason: "test"});
is(e.contactID, "test", "Name should be 'test'.");
is(e.reason, "test", "Name should be 'test'.");
e = new MozContactChangeEvent("contactchanged", {contactID: "a", reason: ""});
is(e.contactID, "a", "Name should be a.");
is(e.reason, "", "Value should be empty");
</script>
</pre>
</body>
</html>