toolkit/mozapps/extensions/test/xpinstall/browser_signed_url.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 // ----------------------------------------------------------------------------
     2 // Tests installing an signed add-on by navigating directly to the url
     3 function test() {
     4   Harness.installConfirmCallback = confirm_install;
     5   Harness.installEndedCallback = install_ended;
     6   Harness.installsCompletedCallback = finish_test;
     7   Harness.setup();
     9   gBrowser.selectedTab = gBrowser.addTab();
    10   gBrowser.loadURI(TESTROOT + "signed.xpi");
    11 }
    13 function confirm_install(window) {
    14   let items = window.document.getElementById("itemList").childNodes;
    15   is(items.length, 1, "Should only be 1 item listed in the confirmation dialog");
    16   is(items[0].name, "Signed XPI Test", "Should have had the name");
    17   is(items[0].url, TESTROOT + "signed.xpi", "Should have listed the correct url for the item");
    18   is(items[0].cert, "(Object Signer)", "Should have seen the signer");
    19   is(items[0].signed, "true", "Should have listed the item as signed");
    20   return true;
    21 }
    23 function install_ended(install, addon) {
    24   install.cancel();
    25 }
    27 function finish_test(count) {
    28   is(count, 1, "1 Add-on should have been successfully installed");
    29   gBrowser.removeCurrentTab();
    30   Harness.finish();
    31 }
    32 // ----------------------------------------------------------------------------

mercurial