summaryrefslogtreecommitdiffstats
path: root/b2g/components/test/unit/test_bug832946.js
blob: 4ddbd4280f7800428ff9adb88fbe2dbb859ab01e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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');
}