Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
/* Any copyright is dedicated to the Public Domain.
"use strict";
add_task(async function test_check_missing_common_name() {
const kURL =
"about:certificate?cert=MIIHVDCCBTygAwIBAgIQOBNAgEopyUI1DYLsLmSWejANBgkqhkiG9w0BAQsFADBYMQswCQYDVQQGEwJUVzESMBAGA1UECgwJ6KGM5pS%2F6ZmiMTUwMwYDVQQDDCzmlL%2FlupzkvLrmnI3lmajmlbjkvY3mhpHorYnnrqHnkIbkuK3lv4MgLSBHMTAeFw0yMDAxMjAwNjExMzBaFw0yMjAxMjAwNjExMzBaMFUxCzAJBgNVBAYTAlRXMQ8wDQYDVQQHDAboh7rngaMxEjAQBgNVBAoMCee4vee1seW6nDEhMB8GA1UEAwwYZW5nbGlzaC5wcmVzaWRlbnQuZ292LnR3MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyxCtEdUsGqr%2FVCNOMpj1TkDzBn6Gs1RBHHERU%2BsJ1q3ri6rJfydTx0rQKUbcGEMyWB2pga4dNSjzxQZ6%2BebP3kctC0H%2F%2BptEnsIOQcyD2yLN5yg8ejx6Y568z3fbU%2FRAVo4q6qGZzlBfzl2AhZMrp3AiNpQZXjLWgNHYZfirDVur7ImSjECq6atLlZ1yn%2B0RC%2FsGsPKalz5iacuxMYIkWeCvm7piA%2FdXPfw%2FVJxbIEkXMSXXxDNGrBZY0wAcmPeDHZxyLDGDOFLV%2Fpics3ZJ4UjFPphwaXuW94K9NKLcfOu7JaYP6JszpBIEiL8GRl8pMdykkKN%2FRkEZ%2F8pE7Tz%2BswIDAQABo4IDGzCCAxcwHwYDVR0jBBgwFoAU1ustnWH%2BK7twiC64B7FZsPSDImowHQYDVR0OBBYEFDxkjGSuIgKbFKTUvadNfX%2B%2BogdCMHUGCCsGAQUFBwEBBGkwZzA1BggrBgEFBQcwAoYpaHR0cDovL2d0bHNjYS5uYXQuZ292LnR3L0NlcnRzL0dUTFNDQS5jcnQwLgYIKwYBB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dXH7OjysP6SHhYKGvzZ8%2Fgntsm%2BHbRsZJB%2F9OTEW9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmODBCEIZ43ygknQW%2F2xzQ%2BDhNQ%2BIIX3Sj0rnP0qCglN6oH4EZw%3D";
await BrowserTestUtils.withNewTab(kURL, async function (browser) {
await SpecialPowers.spawn(browser, [], async function () {
let certificateSection = await ContentTaskUtils.waitForCondition(() => {
return content.document.querySelector("certificate-section");
}, "Certificate section found");
let tabs =
certificateSection.shadowRoot.querySelector(
".certificate-tabs"
).children;
Assert.ok(tabs, "Tabs were found");
Assert.equal(tabs.length, 4, "There should be 4 tabs");
for (let tab of tabs) {
Assert.ok(tab.textContent, "Tab should have non-empty label");
Assert.notEqual(
tab.dataset.l10nId,
"certificate-viewer-unknown-group-label"
);
// If there is another tab after this one, this tab should link to the
// next via its issuer's common name or OU, if available.
if (tab.nextElementSibling) {
tab.click();
let infoGroup = certificateSection.shadowRoot.querySelector(
".selected info-group.issuer-name"
);
Assert.ok(infoGroup, "infoGroup found");
let container =
infoGroup.shadowRoot.querySelector(".common-name") ||
infoGroup.shadowRoot.querySelector(".organizational-unit");
Assert.ok(container, "Should find container for link");
Assert.ok(
container.shadowRoot.querySelector("a"),
"There should be a link in the container for " +
container.textContent
);
}
}
});
});
});