Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 Cu.import("resource://services-sync/notifications.js");
3 function run_test() {
4 var logStats = initTestLogging("Info");
6 var blah = 0;
8 function callback(i) {
9 blah = i;
10 }
12 let button = new NotificationButton("label", "accessKey", callback);
14 button.callback(5);
16 do_check_eq(blah, 5);
17 do_check_eq(logStats.errorsLogged, 0);
19 function badCallback() {
20 throw new Error("oops");
21 }
23 button = new NotificationButton("label", "accessKey", badCallback);
25 try {
26 button.callback();
27 } catch (e) {
28 do_check_eq(e.message, "oops");
29 }
31 do_check_eq(logStats.errorsLogged, 1);
32 }