[bug 896961] Small refactor for two global.js unit tests