The onload handler is basically the same between this and the other test. Could you instead refactor this into a larger primitive in WebGLTestUtils (setupImageForCrossOriginTest?) which takes in the image element, loaded callback, local and remote URLs and sets up the image properly?

Also, please explicitly document that you can override the image's location with the "imgURL" query string.