Issue #4277: fixed some mistakes in tests

Fixed some mistakes in tests:
1. cc.EGLView.getInstance -> cc.view
2. cc.Assert -> cc.assert
3. add a state condition to XHRTest.js