Confirmed users
74
edits
(→loadFrameScript: mention opposite is SpecialPowers.loadChromeScript) |
Mikedeboer (talk | contribs) (Added Assert.jsm reference.) |
||
Line 104: | Line 104: | ||
Remember to yield from <code>ContentTask.spawn</code> so that the test correctly waits for the task to complete. | Remember to yield from <code>ContentTask.spawn</code> so that the test correctly waits for the task to complete. | ||
You can also just use the | You can also just use the [https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/Assert.jsm Assert.jsm] testing functions directly within the ContentTask body, which is useful if you want to check multiple results or perform multiple steps. For example: | ||
yield ContentTask.spawn(browser, "link", function* (arg) { | yield ContentTask.spawn(browser, "link", function* (arg) { | ||
ok(String(content.document.getSelection()), "Hello") | Assert.ok(String(content.document.getSelection()), "Hello"); | ||
} | } | ||