Added tests and fixed case of #fragment in URI

BUG=

Review URL: https://chromiumcodereview.appspot.com//16229004