diff options
Diffstat (limited to 'b2g/components/test/unit/test_bug832946.js')
-rw-r--r-- | b2g/components/test/unit/test_bug832946.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/b2g/components/test/unit/test_bug832946.js b/b2g/components/test/unit/test_bug832946.js new file mode 100644 index 000000000..4ddbd4280 --- /dev/null +++ b/b2g/components/test/unit/test_bug832946.js @@ -0,0 +1,18 @@ +/* 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'); +} |