Wed, 31 Dec 2014 06:55:50 +0100
Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2
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 });