update js-tests codes from upstream and fix a logical bug of CCRect