tenfourfox/b2g/components/test/unit/test_bug832946.js
Cameron Kaiser c9b2922b70 hello FPR
2017-04-19 00:56:45 -07:00

19 lines
769 B
JavaScript

/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
function run_test() {
Components.utils.import("resource:///modules/TelURIParser.jsm")
// blocked numbers
do_check_eq(TelURIParser.parseURI('tel', 'tel:#1234*'), null);
do_check_eq(TelURIParser.parseURI('tel', 'tel:*1234#'), null);
do_check_eq(TelURIParser.parseURI('tel', 'tel:*1234*'), null);
do_check_eq(TelURIParser.parseURI('tel', 'tel:#1234#'), null);
do_check_eq(TelURIParser.parseURI('tel', 'tel:*#*#7780#*#*'), null);
do_check_eq(TelURIParser.parseURI('tel', 'tel:*1234AB'), null);
// white list
do_check_eq(TelURIParser.parseURI('tel', 'tel:*1234'), '*1234');
do_check_eq(TelURIParser.parseURI('tel', 'tel:#1234'), '#1234');
}