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 // Tests for the test functions in head.js
3 function test() {
4 waitForExplicitFinish();
5 runTests();
6 }
8 gTests.push({
9 desc: "task sanity check",
10 run: function() {
11 let sum2plus2 = yield asyncSum(2, 2);
12 ok(sum2plus2 == 4, "asyncSum responded 2+2=4");
14 function asyncSum(a, b) {
15 var defd = Promise.defer();
16 setTimeout(function(){
17 defd.resolve(a+b);
18 }, 25);
19 return defd.promise;
20 }
21 }
22 });
24 gTests.push({
25 desc: "addTab",
26 run: function testAddTab() {
27 let tab = yield addTab("http://example.com/");
28 is(tab, Browser.selectedTab, "The new tab is selected");
29 }
30 });