diff -r 000000000000 -r 6474c204b198 browser/metro/base/tests/mochitest/browser_test.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/browser/metro/base/tests/mochitest/browser_test.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,30 @@ +// Tests for the test functions in head.js + +function test() { + waitForExplicitFinish(); + runTests(); +} + +gTests.push({ + desc: "task sanity check", + run: function() { + let sum2plus2 = yield asyncSum(2, 2); + ok(sum2plus2 == 4, "asyncSum responded 2+2=4"); + + function asyncSum(a, b) { + var defd = Promise.defer(); + setTimeout(function(){ + defd.resolve(a+b); + }, 25); + return defd.promise; + } + } +}); + +gTests.push({ + desc: "addTab", + run: function testAddTab() { + let tab = yield addTab("http://example.com/"); + is(tab, Browser.selectedTab, "The new tab is selected"); + } +});