This whole test setup comes from bug 923904, so some of the things it's testing need to be rejiggered (like the checkGlobal stuff).