I r+ your patch in bug 865273 with comments.

However, I don't like including all utils.js in tests for other files because it has so much more than just these functions. But I know this is less than practical. I don't like having so much code here but I can't come with another better solution...