tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

parsing-addresses.json (2364B)


      1 {
      2  "name": "Relative URL-like addresses",
      3  "tests": {
      4    "should accept strings prefixed with ./, ../, or /": {
      5      "importMap": {
      6        "imports": {
      7          "dotSlash": "./foo",
      8          "dotDotSlash": "../foo",
      9          "slash": "/foo"
     10        }
     11      },
     12      "importMapBaseURL": "https://base.example/path1/path2/path3",
     13      "expectedParsedImportMap": {
     14        "imports": {
     15          "dotSlash": "https://base.example/path1/path2/foo",
     16          "dotDotSlash": "https://base.example/path1/foo",
     17          "slash": "https://base.example/foo"
     18        },
     19        "scopes": {}
     20      }
     21    },
     22    "should not accept strings prefixed with ./, ../, or / for data: base URLs": {
     23      "importMap": {
     24        "imports": {
     25          "dotSlash": "./foo",
     26          "dotDotSlash": "../foo",
     27          "slash": "/foo"
     28        }
     29      },
     30      "importMapBaseURL": "data:text/html,test",
     31      "expectedParsedImportMap": {
     32        "imports": {
     33          "dotSlash": null,
     34          "dotDotSlash": null,
     35          "slash": null
     36        },
     37        "scopes": {}
     38      }
     39    },
     40    "should accept the literal strings ./, ../, or / with no suffix": {
     41      "importMap": {
     42        "imports": {
     43          "dotSlash": "./",
     44          "dotDotSlash": "../",
     45          "slash": "/"
     46        }
     47      },
     48      "importMapBaseURL": "https://base.example/path1/path2/path3",
     49      "expectedParsedImportMap": {
     50        "imports": {
     51          "dotSlash": "https://base.example/path1/path2/",
     52          "dotDotSlash": "https://base.example/path1/",
     53          "slash": "https://base.example/"
     54        },
     55        "scopes": {}
     56      }
     57    },
     58    "should ignore percent-encoded variants of ./, ../, or /": {
     59      "importMap": {
     60        "imports": {
     61          "dotSlash1": "%2E/",
     62          "dotDotSlash1": "%2E%2E/",
     63          "dotSlash2": ".%2F",
     64          "dotDotSlash2": "..%2F",
     65          "slash2": "%2F",
     66          "dotSlash3": "%2E%2F",
     67          "dotDotSlash3": "%2E%2E%2F"
     68        }
     69      },
     70      "importMapBaseURL": "https://base.example/path1/path2/path3",
     71      "expectedParsedImportMap": {
     72        "imports": {
     73          "dotSlash1": null,
     74          "dotDotSlash1": null,
     75          "dotSlash2": null,
     76          "dotDotSlash2": null,
     77          "slash2": null,
     78          "dotSlash3": null,
     79          "dotDotSlash3": null
     80        },
     81        "scopes": {}
     82      }
     83    }
     84  }
     85 }