toolkit/content/tests/chrome/test_bug509732.xul

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 <?xml version="1.0"?>
     2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
     3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
     4 <!--
     5   XUL Widget Test for bug 509732
     6   -->
     7 <window title="Bug 509732" width="500" height="600"
     8         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
     9   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>  
    11     <notificationbox id="nb" hidden="true"/>
    13   <!-- test results are displayed in the html:body -->
    14   <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"
    15         onload="test()"/>
    17   <!-- test code goes here -->
    18 <script type="application/javascript">
    19 <![CDATA[
    20 var gNotificationBox;
    22 // Tests that a notification that is added in an hidden box didn't throw the animation
    23 function test() {
    24   SimpleTest.waitForExplicitFinish();
    25   gNotificationBox = document.getElementById("nb");
    27   is(gNotificationBox.allNotifications.length, 0, "There should be no initial notifications");
    29   gNotificationBox.appendNotification("Test notification",
    30                                       "notification1", null,
    31                                       gNotificationBox.PRIORITY_INFO_LOW,
    32                                       null);
    34   is(gNotificationBox.allNotifications.length, 1, "Notification exists");
    35   is(gNotificationBox._animating, false, "Notification shouldn't be animating");
    37   test1();
    38 }
    40 // Tests that a notification that is removed from an hidden box didn't throw the animation
    41 function test1() {
    42   let notification = gNotificationBox.getNotificationWithValue("notification1");
    43   gNotificationBox.removeNotification(notification);
    44   ok(!gNotificationBox.currentNotification, "Test 1 should show no current animation");
    45   is(gNotificationBox._animating, false, "Notification shouldn't be animating");
    46   is(gNotificationBox.allNotifications.length, 0, "Test 1 should show no notifications present");
    48   SimpleTest.finish();
    49 }
    50 ]]>
    51 </script>
    53 </window>

mercurial