Bug 1070845 - [sharedtest] unit test refactoring for new version chai.assert api (rebased)

test_agent used very old version chai library version=0.5.3 in the current version=1.9.1 deepEqua
ok, I know what happens: these cases are rejected with 'invalid output dimensions' because we don't give any dimension in the call.

If we want to check these cases, we need to add a valid dimension, so that we can pass the early return.

I've tried just this, replacing these 2 lines by
```
          check(ImageUtils.resizeAndCropToCover(null, 1, 10)),
          check(ImageUtils.resizeAndCropToCover('not a blob', 1, 10)),
```

And I get a different error message, because the "null" or "not a blob" gets forwarded to createObjectURL which throws. 

I see that `getSizeAndType` returns a rejected promise, but then in `resizeAndCropToCover` we recover from this rejection and assumes the image exists. I think we should check the rejection's parameter: if it's TypeError, we should rethrow it.