Bug 971507 - Sync the changes in js-test-agent and gaia
Merge pull request #16197 from RickyChien/issue-971507

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