Add tests for JS/CSS resource response processing

@mariansollmann please review
@tomaszdurka fyi

Closes #1331