runat-1128988: Sync helpers.js with Firefox
runat-1128988: Sync helpers.js with Firefox

Someone had added an assert.ok, and we protect ourselves against null
DOM nodes in checking test output

Signed-off-by: Joe Walker <7a17872fbb32c7d760c9a16ee3076daead11efcf@mozilla.com>
joewalker/gcli,mozilla/gcli,joewalker/gcli,mozilla/gcli,mozilla/gcli