Fixes Bug 1032033, build/test/integration/helper.js r=yurenju

#22443 was getting too messy to work with, so closed that and pushed a new one instead.