tor-browser

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

add-success.tentative.https.html (1532B)


      1 <!DOCTYPE html>
      2 <title>Sub Apps: Valid calls for add()</title>
      3 <script src="/resources/testdriver.js"></script>
      4 <script src="/resources/testdriver-vendor.js"></script>
      5 <script src="/resources/testharness.js"></script>
      6 <script src="/resources/testharnessreport.js"></script>
      7 <script src="resources/subapps-helpers.js"></script>
      8 
      9 <script>
     10 
     11 promise_test(async t => {
     12  const install_url = '/sub-app';
     13 
     14  let add_call_params = {
     15    [install_url]: {installURL: install_url}
     16  };
     17 
     18  let mocked_response = [
     19    { "manifestIdPath": install_url, "resultCode": Status.SUCCESS }
     20  ];
     21 
     22  let expected_results = {
     23    [install_url]: "success"
     24  };
     25 
     26  await test_driver.bless("installing a subapp", async function () {
     27    await subapps_add_expect_success_with_result(t, add_call_params, mocked_response, expected_results);
     28  });
     29 }, 'Add API call works with single sub app.');
     30 
     31 promise_test(async t => {
     32  const url_1 = '/sub-app-1';
     33  const url_2 = '/sub-app-2';
     34 
     35  let add_call_params = {
     36    [url_1]: {installURL: url_1},
     37    [url_2]: {installURL: url_2},
     38  };
     39 
     40  let mocked_response = [
     41    { "manifestIdPath": url_1, "resultCode": Status.SUCCESS },
     42    { "manifestIdPath": url_2, "resultCode": Status.SUCCESS }
     43  ];
     44 
     45  let expected_results = {
     46    [url_1]: "success",
     47    [url_2]: "success",
     48  };
     49 
     50 
     51  await test_driver.bless("installing a subapp", async function () {
     52    await subapps_add_expect_success_with_result(t, add_call_params, mocked_response, expected_results);
     53  });
     54 }, 'Add API call works with multiple sub apps.');
     55 
     56 </script>