diff options
Diffstat (limited to 'testing/mochitest/chrome')
-rw-r--r-- | testing/mochitest/chrome/chrome.ini | 16 | ||||
-rw-r--r-- | testing/mochitest/chrome/test-dir/test-file | 1 | ||||
-rw-r--r-- | testing/mochitest/chrome/test_chromeGetTestFile.xul | 55 | ||||
-rw-r--r-- | testing/mochitest/chrome/test_sample.xul | 36 | ||||
-rw-r--r-- | testing/mochitest/chrome/test_sanityAddTask.xul | 43 | ||||
-rw-r--r-- | testing/mochitest/chrome/test_sanityEventUtils.xul | 192 | ||||
-rw-r--r-- | testing/mochitest/chrome/test_sanityException.xul | 23 | ||||
-rw-r--r-- | testing/mochitest/chrome/test_sanityException2.xul | 29 | ||||
-rw-r--r-- | testing/mochitest/chrome/test_sanityManifest.xul | 19 | ||||
-rw-r--r-- | testing/mochitest/chrome/test_sanityManifest_pf.xul | 20 | ||||
-rw-r--r-- | testing/mochitest/chrome/test_sanityPluginUtils.html | 38 | ||||
-rw-r--r-- | testing/mochitest/chrome/test_sanitySpawnTask.xul | 70 |
12 files changed, 542 insertions, 0 deletions
diff --git a/testing/mochitest/chrome/chrome.ini b/testing/mochitest/chrome/chrome.ini new file mode 100644 index 0000000000..b29e972576 --- /dev/null +++ b/testing/mochitest/chrome/chrome.ini @@ -0,0 +1,16 @@ +[DEFAULT] +skip-if = os == 'android' +support-files = test-dir/test-file + +[test_sample.xul] +[test_sanityAddTask.xul] +[test_sanityEventUtils.xul] +[test_sanityPluginUtils.html] +[test_sanityException.xul] +[test_sanityException2.xul] +[test_sanityManifest.xul] +fail-if = true +[test_sanityManifest_pf.xul] +fail-if = true +[test_sanitySpawnTask.xul] +[test_chromeGetTestFile.xul] diff --git a/testing/mochitest/chrome/test-dir/test-file b/testing/mochitest/chrome/test-dir/test-file new file mode 100644 index 0000000000..257cc5642c --- /dev/null +++ b/testing/mochitest/chrome/test-dir/test-file @@ -0,0 +1 @@ +foo diff --git a/testing/mochitest/chrome/test_chromeGetTestFile.xul b/testing/mochitest/chrome/test_chromeGetTestFile.xul new file mode 100644 index 0000000000..e1372722b0 --- /dev/null +++ b/testing/mochitest/chrome/test_chromeGetTestFile.xul @@ -0,0 +1,55 @@ +<?xml version="1.0"?> +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" + type="text/css"?> +<window title="Test chrome harness functions" + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> + <script type="application/javascript" + src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/> + <script type="application/javascript" src="chrome://mochikit/content/chrome-harness.js"></script> + <script type="application/javascript"> + <![CDATA[ + let {Promise} = Components.utils.import("resource://gre/modules/Promise.jsm"); + Components.utils.import("resource://gre/modules/osfile.jsm"); + let decoder = new TextDecoder(); + + SimpleTest.waitForExplicitFinish(); + + SimpleTest.doesThrow(function () { + getTestFilePath("/test_chromeGetTestFile.xul") + }, "getTestFilePath rejects absolute paths"); + + Promise.all([ + OS.File.exists(getTestFilePath("test_chromeGetTestFile.xul")) + .then(function (exists) { + ok(exists, "getTestFilePath consider the path as being relative"); + }), + + OS.File.exists(getTestFilePath("./test_chromeGetTestFile.xul")) + .then(function (exists) { + ok(exists, "getTestFilePath also accepts explicit relative path"); + }), + + OS.File.exists(getTestFilePath("./test_chromeGetTestFileTypo.xul")) + .then(function (exists) { + ok(!exists, "getTestFilePath do not throw if the file doesn't exists"); + }), + + OS.File.read(getTestFilePath("test-dir/test-file")) + .then(function (array) { + is(decoder.decode(array), "foo\n", "getTestFilePath can reach sub-folder files 1/2"); + }), + + OS.File.read(getTestFilePath("./test-dir/test-file")) + .then(function (array) { + is(decoder.decode(array), "foo\n", "getTestFilePath can reach sub-folder files 2/2"); + }) + + ]).then(function () { + SimpleTest.finish(); + }, console.error); + ]]> + </script> +</window> diff --git a/testing/mochitest/chrome/test_sample.xul b/testing/mochitest/chrome/test_sample.xul new file mode 100644 index 0000000000..957bcd29c5 --- /dev/null +++ b/testing/mochitest/chrome/test_sample.xul @@ -0,0 +1,36 @@ +<?xml version="1.0"?> +<?xml-stylesheet href="chrome://global/skin" type="text/css"?> +<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" + type="text/css"?> +<!-- +https://bugzilla.mozilla.org/show_bug.cgi?id=8675309 +--> +<window title="Mozilla Bug 8675309" + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> + + <script type="application/javascript" + src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" /> + +<body xmlns="http://www.w3.org/1999/xhtml"> +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=8675309">Mozilla Bug 8675309</a> +<p id="display"></p> +<div id="content" style="display: none"> + +</div> +<pre id="test"> +</pre> +</body> + +<script class="testbody" type="application/javascript"> +<![CDATA[ + +/** Test for Bug 8675309 **/ + +ok(true, "sanity check"); + + + +]]> +</script> + +</window> diff --git a/testing/mochitest/chrome/test_sanityAddTask.xul b/testing/mochitest/chrome/test_sanityAddTask.xul new file mode 100644 index 0000000000..006acbaa7d --- /dev/null +++ b/testing/mochitest/chrome/test_sanityAddTask.xul @@ -0,0 +1,43 @@ +<?xml version="1.0"?> +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" + type="text/css"?> +<window title="Test spawnTawk function" + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> + <script type="application/javascript" + src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/> + <script type="application/javascript" + src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"/> + <script type="application/javascript"> + <![CDATA[ + + // Check that we can 'add_task' a few times and all tasks run asynchronously before test finishes. + + add_task(function* () { + var x = yield Promise.resolve(1); + is(x, 1, "task yields Promise value as expected"); + }); + + add_task(function* () { + var x = yield [Promise.resolve(1), Promise.resolve(2), Promise.resolve(3)]; + is(x.join(""), "123", "task yields Promise value as expected"); + }); + + add_task(function* () { + var x = yield (function* () { + return 3; + }()); + is(x, 3, "task yields generator function return value as expected"); + }); + + ]]> + </script> + <body xmlns="http://www.w3.org/1999/xhtml" > + </body> +</window> + + + + diff --git a/testing/mochitest/chrome/test_sanityEventUtils.xul b/testing/mochitest/chrome/test_sanityEventUtils.xul new file mode 100644 index 0000000000..6ac098d2ea --- /dev/null +++ b/testing/mochitest/chrome/test_sanityEventUtils.xul @@ -0,0 +1,192 @@ +<?xml version="1.0"?> +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" + type="text/css"?> +<window title="Test EventUtils functions" + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> + <script type="application/javascript" + src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/> + <script type="text/javascript"> + var start = new Date(); + </script> + <script type="application/javascript" + src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script> + <script type="text/javascript"> + var loadTime = new Date(); + </script> + <script type="application/javascript"> + <![CDATA[ + info("\nProfile::EventUtilsLoadTime: " + (loadTime - start) + "\n"); + var testFile = Components.classes["@mozilla.org/file/directory_service;1"]. + getService(Components.interfaces.nsIProperties). + get("CurWorkD", Components.interfaces.nsIFile); + var regularDtForDrag1 = null; + var gSetDropEffect = true; + var gData; + var gEnter = false; + var gOver = false; + var dragDrop = [[ + { type : "text/plain", + data : "This is a test" } + ]]; + // this is the expected data arrays + // for testing drag of 2 items create 2 inner arrays + var drag1 = [[ + { type : "text/uri-list", + data : "http://www.mozilla.org/" } + ]]; + var drag2items = [[ + { type : "text/uri-list", + data : "http://www.mozilla.org/" } + ],[ + { type : "text/uri-list", + data : "http://www.mozilla.org/" } + ]]; + var drag1WrongFlavor = [[ + { type : "text/plain", + data : "this is text/plain" } + ]]; + var drag2 = [[ + { type : "text/plain", + data : "this is text/plain" }, + { type : "text/uri-list", + data : "http://www.mozilla.org/" } + ]]; + var drag2WrongOrder = [[ + { type : "text/uri-list", + data : "http://www.mozilla.org/" }, + { type : "text/plain", + data : "this is text/plain" } + ]]; + var dragfile = [[ + { type : "application/x-moz-file", + data : testFile, + eqTest : function(actualData, expectedData) {return expectedData.equals(actualData);} }, + { type : "Files", + data : null } + ]]; + + function doOnDrop(aEvent) { + gData = aEvent.dataTransfer.getData(dragDrop[0][0].type); + aEvent.preventDefault(); // cancels event and keeps dropEffect + // as was before event. + } + + function doOnDragStart(aEvent) { + var dt = aEvent.dataTransfer; + switch (aEvent.currentTarget.id) { + case "drag2" : + dt.setData("text/plain", "this is text/plain"); + case "drag1" : + regularDtForDrag1 = dt; + dt.setData("text/uri-list", "http://www.mozilla.org/"); + break; + case "dragfile" : + dt.mozSetDataAt("application/x-moz-file", testFile, 0); + break; + } + dt.effectAllowed = "all"; + } + + function doOnDragEnter(aEvent) { + gEnter = true; + aEvent.dataTransfer.effectAllowed = "all"; + aEvent.preventDefault(); // sets target this element + } + + function doOnDragOver(aEvent) { + gOver = true; + if (gSetDropEffect) + aEvent.dataTransfer.dropEffect = "copy"; + aEvent.preventDefault(); + } + + SimpleTest.waitForExplicitFinish(); + function test() { + var startTime = new Date(); + var result; + + /* test synthesizeDragStart */ + result = synthesizeDragStart($("drag1"), drag1, window); + is(result, null, "drag1 is text/uri-list"); + result = synthesizeDragStart($("drag1"), drag1WrongFlavor, window); + isnot(result, null, "drag1 is not text/plain"); + result = synthesizeDragStart($("drag1"), drag2items, window); + isnot(result, null, "drag1 is not 2 items"); + result = synthesizeDragStart($("drag2"), drag2, window); + is(result, null, "drag2 is ordered text/plain then text/uri-list"); + result = synthesizeDragStart($("drag2"), drag1, window); + isnot(result, null, "drag2 is not one flavor"); + result = synthesizeDragStart($("drag2"), drag2WrongOrder, window); + isnot(result, null, "drag2 is not ordered text/uri-list then text/plain"); + result = synthesizeDragStart($("dragfile"), dragfile, window); + is(result, null, "dragfile is nsIFile"); + result = synthesizeDragStart($("drag1"), null, window); + is(result, regularDtForDrag1, "synthesizeDragStart accepts null expectedDragData"); + + /* test synthesizeDrop */ + result = synthesizeDrop($("dragDrop"), $("dragDrop"), dragDrop, null, window); + ok(gEnter, "Fired dragenter"); + ok(gOver, "Fired dragover"); + is(result, "copy", "copy is dropEffect"); + is(gData, dragDrop[0][0].data, "Received valid drop data"); + + gSetDropEffect = false; + result = synthesizeDrop($("dragDrop"), $("dragDrop"), dragDrop, "link", window); + is(result, "link", "link is dropEffect"); + gSetDropEffect = true; + + $("textB").focus(); + var content = synthesizeQueryTextContent(0, 100); + ok(content, "synthesizeQueryTextContent should not be null"); + ok(content.succeeded, "synthesizeQueryTextContent should succeed"); + is(content.text, "I haz a content", "synthesizeQueryTextContent should be 'I haz a content': " + content.text); + + content = synthesizeQueryCaretRect(0); + ok(content, "synthesizeQueryCaretRect should not be null"); + ok(content.succeeded, "synthesizeQueryCaretRect should succeed"); + + content = synthesizeQueryTextRect(0, 100); + ok(content, "synthesizeQueryTextRect should not be null"); + ok(content.succeeded, "synthesizeQueryTextRect should succeed"); + + content = synthesizeQueryEditorRect(); + ok(content, "synthesizeQueryEditorRect should not be null"); + ok(content.succeeded, "synthesizeQueryEditorRect should succeed"); + + content = synthesizeCharAtPoint(0, 0); + ok(content, "synthesizeCharAtPoint should not be null"); + ok(content.succeeded, "synthesizeCharAtPoint should succeed"); + + content = synthesizeSelectionSet(0, 100); + ok(content, "synthesizeSelectionSet should not be null"); + is(content, true, "synthesizeSelectionSet should succeed"); + + var endTime = new Date(); + info("\nProfile::EventUtilsRunTime: " + (endTime-startTime) + "\n"); + SimpleTest.finish(); + }; + ]]> + </script> + + <body xmlns="http://www.w3.org/1999/xhtml" onload="setTimeout('test()', 0)"> + <input id="textB" value="I haz a content"/> + <p id="display"></p> + <div id="content" style="display:none;"></div> + <pre id="test"></pre> + <div id="drag1" ondragstart="doOnDragStart(event);">Need some space here</div> + <p id="display"></p> + <div id="content" style="display:none;"></div> + <pre id="test"></pre> + <div id="dragDrop" ondragover ="doOnDragOver(event);" + ondragenter ="doOnDragEnter(event);" + ondragleave ="doOnDragLeave(event);" + ondrop ="doOnDrop(event);"> + Need some depth and height to drag here + </div> + <div id="drag2" ondragstart="doOnDragStart(event);">Need more space</div> + <div id="dragfile" ondragstart="doOnDragStart(event);">Sure why not here too</div> + </body> +</window> diff --git a/testing/mochitest/chrome/test_sanityException.xul b/testing/mochitest/chrome/test_sanityException.xul new file mode 100644 index 0000000000..420269e4d2 --- /dev/null +++ b/testing/mochitest/chrome/test_sanityException.xul @@ -0,0 +1,23 @@ +<?xml version="1.0"?> +<?xml-stylesheet href="chrome://global/skin" type="text/css"?> +<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?> +<!-- +https://bugzilla.mozilla.org/show_bug.cgi?id=670817 +--> +<window title="Mozilla Bug 670817" + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> + + <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/> + +<body xmlns="http://www.w3.org/1999/xhtml"> +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=670817">Mozilla Bug 670817</a> +<script type="application/javascript"><![CDATA[ + +SimpleTest.expectUncaughtException(); +ok(true, "a call to ok"); +throw "this is a deliberately thrown exception"; + +]]></script> +</body> + +</window> diff --git a/testing/mochitest/chrome/test_sanityException2.xul b/testing/mochitest/chrome/test_sanityException2.xul new file mode 100644 index 0000000000..450fd838c0 --- /dev/null +++ b/testing/mochitest/chrome/test_sanityException2.xul @@ -0,0 +1,29 @@ +<?xml version="1.0"?> +<?xml-stylesheet href="chrome://global/skin" type="text/css"?> +<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?> +<!-- +https://bugzilla.mozilla.org/show_bug.cgi?id=670817 +--> +<window title="Mozilla Bug 670817" + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> + + <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/> + +<body xmlns="http://www.w3.org/1999/xhtml"> +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=670817">Mozilla Bug 670817</a> +<script type="application/javascript"><![CDATA[ + +SimpleTest.waitForExplicitFinish(); +ok(true, "a call to ok"); +SimpleTest.executeSoon(function() { + SimpleTest.expectUncaughtException(); + throw "this is a deliberately thrown exception"; +}); +SimpleTest.executeSoon(function() { + SimpleTest.finish(); +}); + +]]></script> +</body> + +</window> diff --git a/testing/mochitest/chrome/test_sanityManifest.xul b/testing/mochitest/chrome/test_sanityManifest.xul new file mode 100644 index 0000000000..ff92c37325 --- /dev/null +++ b/testing/mochitest/chrome/test_sanityManifest.xul @@ -0,0 +1,19 @@ +<?xml version="1.0"?> +<?xml-stylesheet href="chrome://global/skin" type="text/css"?> +<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?> +<!-- +https://bugzilla.mozilla.org/show_bug.cgi?id=670817 +--> +<window title="Mozilla Bug 987849" + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> + + <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/> + +<body xmlns="http://www.w3.org/1999/xhtml"> +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=987849">Mozilla Bug 987849</a> +<script type="application/javascript"><![CDATA[ +ok(false, "a call to ok"); +]]></script> +</body> + +</window> diff --git a/testing/mochitest/chrome/test_sanityManifest_pf.xul b/testing/mochitest/chrome/test_sanityManifest_pf.xul new file mode 100644 index 0000000000..7500d155e7 --- /dev/null +++ b/testing/mochitest/chrome/test_sanityManifest_pf.xul @@ -0,0 +1,20 @@ +<?xml version="1.0"?> +<?xml-stylesheet href="chrome://global/skin" type="text/css"?> +<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?> +<!-- +https://bugzilla.mozilla.org/show_bug.cgi?id=670817 +--> +<window title="Mozilla Bug 987849" + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> + + <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/> + +<body xmlns="http://www.w3.org/1999/xhtml"> +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=987849">Mozilla Bug 987849</a> +<script type="application/javascript"><![CDATA[ +ok(true, "a true call to ok"); +ok(false, "a false call to ok"); +]]></script> +</body> + +</window> diff --git a/testing/mochitest/chrome/test_sanityPluginUtils.html b/testing/mochitest/chrome/test_sanityPluginUtils.html new file mode 100644 index 0000000000..f0814259e5 --- /dev/null +++ b/testing/mochitest/chrome/test_sanityPluginUtils.html @@ -0,0 +1,38 @@ +<!DOCTYPE HTML> +<html> +<head> + <script type="text/javascript"> + var start = new Date(); + </script> + <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script> + <script type="text/javascript"> + var loadTime = new Date(); + </script> + <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> + <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" /> +</head> +<body onload="starttest()"> +<!-- load the test plugin defined at $(DIST)/bin/plugins/Test.plugin/ --> +<embed id="plugin1" type="application/x-test" width="200" height="200"></embed> +<script class="testbody" type="text/javascript"> +info("\nProfile::PluginUtilsLoadTime: " + (loadTime - start) + "\n"); +function starttest() { + SimpleTest.waitForExplicitFinish(); + var startTime = new Date(); + //increase the runtime of the test so it is detectible, otherwise we get 0-1ms + runtimes = 100; + function runTest(plugin) { + is(plugin.version, "1.0.0.0", "Make sure version is correct"); + is(plugin.name, "Test Plug-in"); + }; + while (runtimes > 0) { + ok(PluginUtils.withTestPlugin(runTest), "Test plugin should be found"); + --runtimes; + } + var endTime = new Date(); + info("\nProfile::PluginUtilsRunTime: " + (endTime-startTime) + "\n"); + SimpleTest.finish(); +}; +</script> +</body> +</html> diff --git a/testing/mochitest/chrome/test_sanitySpawnTask.xul b/testing/mochitest/chrome/test_sanitySpawnTask.xul new file mode 100644 index 0000000000..d3f0ccc1f5 --- /dev/null +++ b/testing/mochitest/chrome/test_sanitySpawnTask.xul @@ -0,0 +1,70 @@ +<?xml version="1.0"?> +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" + type="text/css"?> +<window title="Test spawnTawk function" + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> + <script type="application/javascript" + src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/> + <script type="application/javascript" + src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"/> + <script type="application/javascript"> + <![CDATA[ + SimpleTest.waitForExplicitFinish(); + + var externalGeneratorFunction = function* () { + return 8; + }; + + var nestedFunction = function* () { + return yield function* () { + return yield function* () { + return yield function* () { + return yield Promise.resolve(9); + }(); + }(); + }(); + } + + var variousTests = function* () { + var val1 = yield [Promise.resolve(1), Promise.resolve(2), Promise.resolve(3)]; + is(val1.join(""), "123", "Array of promises -> Promise.all"); + var val2 = yield Promise.resolve(2); + is(val2, 2, "Resolved promise yields value."); + var val3 = yield function* () { return 3; }; + is(val3, 3, "Generator functions are spawned."); + //var val4 = yield function () { return 4; }; + //is(val4, 4, "Plain functions run and return."); + var val5 = yield (function* () { return 5; }()); + is(val5, 5, "Generators are spawned."); + try { + var val6 = yield Promise.reject(Error("error6")); + ok(false, "Shouldn't reach this line."); + } catch (error) { + is(error.message, "error6", "Rejected promise throws error."); + } + try { + var val7 = yield function* () { throw Error("error7"); }; + ok(false, "Shouldn't reach this line."); + } catch (error) { + is(error.message, "error7", "Thrown error propagates."); + } + var val8 = yield externalGeneratorFunction(); + is(val8, 8, "External generator also spawned."); + var val9 = yield nestedFunction(); + is(val9, 9, "Nested generator functions work."); + return 10; + }; + + spawn_task(variousTests).then(function(result) { + is(result, 10, "spawn_task(...) returns promise"); + SimpleTest.finish(); + }); + ]]> + </script> + + <body xmlns="http://www.w3.org/1999/xhtml" > + </body> +</window> |