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.

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

mercurial