browser/components/feeds/test/unit/test_758990.js

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

michael@0 1 function run_test() {
michael@0 2 var success = false;
michael@0 3 try {
michael@0 4 var newURI = ios.newURI("feed:javascript:alert('hi');", null, null);
michael@0 5 }
michael@0 6 catch (e) {
michael@0 7 success = e.result == Cr.NS_ERROR_MALFORMED_URI;
michael@0 8 }
michael@0 9 if (!success)
michael@0 10 do_throw("We didn't throw NS_ERROR_MALFORMED_URI creating a feed:javascript: URI");
michael@0 11
michael@0 12 success = false;
michael@0 13 try {
michael@0 14 newURI = ios.newURI("feed:data:text/html,hi", null, null);
michael@0 15 }
michael@0 16 catch (e) {
michael@0 17 success = e.result == Cr.NS_ERROR_MALFORMED_URI;
michael@0 18 }
michael@0 19 if (!success)
michael@0 20 do_throw("We didn't throw NS_ERROR_MALFORMED_URI creating a feed:data: URI");
michael@0 21
michael@0 22 success = false;
michael@0 23 try {
michael@0 24 newURI = ios.newURI("pcast:javascript:alert('hi');", null, null);
michael@0 25 }
michael@0 26 catch (e) {
michael@0 27 success = e.result == Cr.NS_ERROR_MALFORMED_URI;
michael@0 28 }
michael@0 29 if (!success)
michael@0 30 do_throw("We didn't throw NS_ERROR_MALFORMED_URI creating a pcast:javascript: URI");
michael@0 31
michael@0 32 success = false;
michael@0 33 try {
michael@0 34 newURI = ios.newURI("pcast:data:text/html,hi", null, null);
michael@0 35 }
michael@0 36 catch (e) {
michael@0 37 success = e.result == Cr.NS_ERROR_MALFORMED_URI;
michael@0 38 }
michael@0 39 if (!success)
michael@0 40 do_throw("We didn't throw NS_ERROR_MALFORMED_URI creating a pcast:data: URI");
michael@0 41
michael@0 42 }

mercurial