Bug 971507 - Sync the changes in js-test-agent and gaia