);
    return readPixelView;
  }

  if (!probeWithBadOffset(doReadPixels, "doReadPixels"))
    break;

  for (var i = 0; i <= readPixelView.length+1; i++) {
    debug("offset=" + i);
    var res = doReadPixels(i);
    var effectiveViewLen = readPixelView.length - i;

    if (effectiveViewLen >= 4) {
      wtu.glErrorShouldBe(gl, gl.NO_ERROR);
      shouldBeWasArr(testColor, res.slice(i,i+4));

    } else if (effectiveViewLen >= 0) {
      wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION);

    } else {
      wt