Bug 998757 - Follow up of Bug 972699 - Sync the changes in js-test-agent...

... and gaia