canvas: add some test funcs from mozilla tutorial