From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- dom/l10n/tests/gtest/TestL10nOverlays.cpp | 77 +++++ dom/l10n/tests/gtest/moz.build | 11 + dom/l10n/tests/mochitest/browser.ini | 6 + dom/l10n/tests/mochitest/chrome.ini | 47 +++ dom/l10n/tests/mochitest/document_l10n/README.txt | 3 + .../document_l10n/non-system-principal/README.txt | 3 + .../non-system-principal/browser_resource_uri.js | 109 +++++++ .../non-system-principal/localization/test.ftl | 4 + .../document_l10n/non-system-principal/test.html | 37 +++ .../test_connectRoot_webcomponent.html | 90 ++++++ .../test_connectRoot_webcomponent_lazy.html | 98 ++++++ .../mochitest/document_l10n/test_docl10n.html | 66 ++++ .../mochitest/document_l10n/test_docl10n.xhtml | 60 ++++ .../mochitest/document_l10n/test_docl10n_lazy.html | 44 +++ .../document_l10n/test_docl10n_ready_rejected.html | 29 ++ .../test_docl10n_removeResourceIds.html | 59 ++++ .../mochitest/document_l10n/test_docl10n_sync.html | 54 ++++ .../mochitest/document_l10n/test_telemetry.html | 83 +++++ .../document_l10n/test_unpriv_iframe.html | 26 ++ .../dom_localization/test_attr_sanitized.html | 49 +++ .../dom_localization/test_connectRoot.html | 45 +++ .../test_connectRoot_webcomponent.html | 72 +++++ .../dom_localization/test_disconnectRoot.html | 60 ++++ .../mochitest/dom_localization/test_domloc.xhtml | 68 ++++ .../dom_localization/test_getAttributes.html | 49 +++ .../dom_localization/test_l10n_mutations.html | 57 ++++ .../mochitest/dom_localization/test_overlay.html | 60 ++++ .../dom_localization/test_overlay_missing_all.html | 37 +++ .../test_overlay_missing_children.html | 53 ++++ .../dom_localization/test_overlay_repeated.html | 50 +++ .../dom_localization/test_overlay_sanitized.html | 52 ++++ .../dom_localization/test_repeated_l10nid.html | 60 ++++ .../dom_localization/test_setAttributes.html | 79 +++++ .../dom_localization/test_translateElements.html | 47 +++ .../dom_localization/test_translateFragment.html | 48 +++ .../dom_localization/test_translateRoots.html | 56 ++++ .../test_append_content_post_dcl.html | 30 ++ .../test_append_content_pre_dcl.html | 28 ++ .../test_append_fragment_post_dcl.html | 39 +++ .../test_disconnectedRoot_webcomponent.html | 148 +++++++++ .../l10n_mutations/test_pause_observing.html | 44 +++ .../l10n_mutations/test_remove_element.html | 68 ++++ .../l10n_mutations/test_remove_fragment.html | 67 ++++ .../l10n_mutations/test_set_attributes.html | 37 +++ .../mochitest/l10n_mutations/test_template.html | 37 +++ .../mochitest/l10n_overlays/test_attributes.html | 86 ++++++ .../l10n_overlays/test_extra_text_markup.html | 136 ++++++++ .../l10n_overlays/test_functional_children.html | 344 +++++++++++++++++++++ .../l10n_overlays/test_l10n_overlays.xhtml | 87 ++++++ .../mochitest/l10n_overlays/test_same_id.html | 57 ++++ .../mochitest/l10n_overlays/test_same_id_args.html | 57 ++++ .../l10n_overlays/test_text_children.html | 74 +++++ .../tests/mochitest/l10n_overlays/test_title.html | 60 ++++ dom/l10n/tests/mochitest/mochitest.ini | 1 + 54 files changed, 3248 insertions(+) create mode 100644 dom/l10n/tests/gtest/TestL10nOverlays.cpp create mode 100644 dom/l10n/tests/gtest/moz.build create mode 100644 dom/l10n/tests/mochitest/browser.ini create mode 100644 dom/l10n/tests/mochitest/chrome.ini create mode 100644 dom/l10n/tests/mochitest/document_l10n/README.txt create mode 100644 dom/l10n/tests/mochitest/document_l10n/non-system-principal/README.txt create mode 100644 dom/l10n/tests/mochitest/document_l10n/non-system-principal/browser_resource_uri.js create mode 100644 dom/l10n/tests/mochitest/document_l10n/non-system-principal/localization/test.ftl create mode 100644 dom/l10n/tests/mochitest/document_l10n/non-system-principal/test.html create mode 100644 dom/l10n/tests/mochitest/document_l10n/test_connectRoot_webcomponent.html create mode 100644 dom/l10n/tests/mochitest/document_l10n/test_connectRoot_webcomponent_lazy.html create mode 100644 dom/l10n/tests/mochitest/document_l10n/test_docl10n.html create mode 100644 dom/l10n/tests/mochitest/document_l10n/test_docl10n.xhtml create mode 100644 dom/l10n/tests/mochitest/document_l10n/test_docl10n_lazy.html create mode 100644 dom/l10n/tests/mochitest/document_l10n/test_docl10n_ready_rejected.html create mode 100644 dom/l10n/tests/mochitest/document_l10n/test_docl10n_removeResourceIds.html create mode 100644 dom/l10n/tests/mochitest/document_l10n/test_docl10n_sync.html create mode 100644 dom/l10n/tests/mochitest/document_l10n/test_telemetry.html create mode 100644 dom/l10n/tests/mochitest/document_l10n/test_unpriv_iframe.html create mode 100644 dom/l10n/tests/mochitest/dom_localization/test_attr_sanitized.html create mode 100644 dom/l10n/tests/mochitest/dom_localization/test_connectRoot.html create mode 100644 dom/l10n/tests/mochitest/dom_localization/test_connectRoot_webcomponent.html create mode 100644 dom/l10n/tests/mochitest/dom_localization/test_disconnectRoot.html create mode 100644 dom/l10n/tests/mochitest/dom_localization/test_domloc.xhtml create mode 100644 dom/l10n/tests/mochitest/dom_localization/test_getAttributes.html create mode 100644 dom/l10n/tests/mochitest/dom_localization/test_l10n_mutations.html create mode 100644 dom/l10n/tests/mochitest/dom_localization/test_overlay.html create mode 100644 dom/l10n/tests/mochitest/dom_localization/test_overlay_missing_all.html create mode 100644 dom/l10n/tests/mochitest/dom_localization/test_overlay_missing_children.html create mode 100644 dom/l10n/tests/mochitest/dom_localization/test_overlay_repeated.html create mode 100644 dom/l10n/tests/mochitest/dom_localization/test_overlay_sanitized.html create mode 100644 dom/l10n/tests/mochitest/dom_localization/test_repeated_l10nid.html create mode 100644 dom/l10n/tests/mochitest/dom_localization/test_setAttributes.html create mode 100644 dom/l10n/tests/mochitest/dom_localization/test_translateElements.html create mode 100644 dom/l10n/tests/mochitest/dom_localization/test_translateFragment.html create mode 100644 dom/l10n/tests/mochitest/dom_localization/test_translateRoots.html create mode 100644 dom/l10n/tests/mochitest/l10n_mutations/test_append_content_post_dcl.html create mode 100644 dom/l10n/tests/mochitest/l10n_mutations/test_append_content_pre_dcl.html create mode 100644 dom/l10n/tests/mochitest/l10n_mutations/test_append_fragment_post_dcl.html create mode 100644 dom/l10n/tests/mochitest/l10n_mutations/test_disconnectedRoot_webcomponent.html create mode 100644 dom/l10n/tests/mochitest/l10n_mutations/test_pause_observing.html create mode 100644 dom/l10n/tests/mochitest/l10n_mutations/test_remove_element.html create mode 100644 dom/l10n/tests/mochitest/l10n_mutations/test_remove_fragment.html create mode 100644 dom/l10n/tests/mochitest/l10n_mutations/test_set_attributes.html create mode 100644 dom/l10n/tests/mochitest/l10n_mutations/test_template.html create mode 100644 dom/l10n/tests/mochitest/l10n_overlays/test_attributes.html create mode 100644 dom/l10n/tests/mochitest/l10n_overlays/test_extra_text_markup.html create mode 100644 dom/l10n/tests/mochitest/l10n_overlays/test_functional_children.html create mode 100644 dom/l10n/tests/mochitest/l10n_overlays/test_l10n_overlays.xhtml create mode 100644 dom/l10n/tests/mochitest/l10n_overlays/test_same_id.html create mode 100644 dom/l10n/tests/mochitest/l10n_overlays/test_same_id_args.html create mode 100644 dom/l10n/tests/mochitest/l10n_overlays/test_text_children.html create mode 100644 dom/l10n/tests/mochitest/l10n_overlays/test_title.html create mode 100644 dom/l10n/tests/mochitest/mochitest.ini (limited to 'dom/l10n/tests') diff --git a/dom/l10n/tests/gtest/TestL10nOverlays.cpp b/dom/l10n/tests/gtest/TestL10nOverlays.cpp new file mode 100644 index 0000000000..c6c9da9939 --- /dev/null +++ b/dom/l10n/tests/gtest/TestL10nOverlays.cpp @@ -0,0 +1,77 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "gtest/gtest.h" +#include "mozilla/dom/L10nOverlays.h" +#include "mozilla/dom/Document.h" +#include "mozilla/dom/L10nOverlaysBinding.h" +#include "mozilla/dom/Element.h" +#include "mozilla/NullPrincipal.h" +#include "nsNetUtil.h" + +using mozilla::NullPrincipal; +using namespace mozilla::dom; + +static already_AddRefed SetUpDocument() { + nsCOMPtr uri; + NS_NewURI(getter_AddRefs(uri), "about:blank"); + nsCOMPtr principal = + NullPrincipal::CreateWithoutOriginAttributes(); + nsCOMPtr document; + nsresult rv = NS_NewDOMDocument(getter_AddRefs(document), + u""_ns, // aNamespaceURI + u""_ns, // aQualifiedName + nullptr, // aDoctype + uri, uri, principal, + false, // aLoadedAsData + nullptr, // aEventObject + DocumentFlavorHTML); + + if (NS_WARN_IF(NS_FAILED(rv))) { + return nullptr; + } + return document.forget(); +} + +/** + * This test verifies that the basic C++ DOM L10nOverlays API + * works correctly. + */ +TEST(DOM_L10n_Overlays, Initial) +{ + mozilla::ErrorResult rv; + + // 1. Set up an HTML document. + nsCOMPtr doc = SetUpDocument(); + + // 2. Create a simple Element with a child. + // + //
+ // + //
+ // + RefPtr elem = doc->CreateHTMLElement(nsGkAtoms::div); + RefPtr span = doc->CreateHTMLElement(nsGkAtoms::a); + span->SetAttribute(u"data-l10n-name"_ns, u"link"_ns, rv); + span->SetAttribute(u"href"_ns, u"https://www.mozilla.org"_ns, rv); + elem->AppendChild(*span, rv); + + // 3. Create an L10nMessage with a translation for the element. + L10nMessage translation; + translation.mValue.AssignLiteral( + "Hello World."); + + // 4. Translate the element. + nsTArray errors; + L10nOverlays::TranslateElement(*elem, translation, errors, rv); + + nsAutoString textContent; + elem->GetInnerHTML(textContent, rv); + + // 5. Verify that the innerHTML matches the expectations. + ASSERT_STREQ(NS_ConvertUTF16toUTF8(textContent).get(), + "Hello World."); +} diff --git a/dom/l10n/tests/gtest/moz.build b/dom/l10n/tests/gtest/moz.build new file mode 100644 index 0000000000..0e1e2173a6 --- /dev/null +++ b/dom/l10n/tests/gtest/moz.build @@ -0,0 +1,11 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +UNIFIED_SOURCES += [ + "TestL10nOverlays.cpp", +] + +FINAL_LIBRARY = "xul-gtest" diff --git a/dom/l10n/tests/mochitest/browser.ini b/dom/l10n/tests/mochitest/browser.ini new file mode 100644 index 0000000000..966be56661 --- /dev/null +++ b/dom/l10n/tests/mochitest/browser.ini @@ -0,0 +1,6 @@ +[document_l10n/non-system-principal/browser_resource_uri.js] +support-files = + document_l10n/non-system-principal/test.html + document_l10n/non-system-principal/localization/test.ftl +skip-if = + os == "win" && os_version == "6.1" # Skip on Azure - frequent failure diff --git a/dom/l10n/tests/mochitest/chrome.ini b/dom/l10n/tests/mochitest/chrome.ini new file mode 100644 index 0000000000..68f3d89d40 --- /dev/null +++ b/dom/l10n/tests/mochitest/chrome.ini @@ -0,0 +1,47 @@ +[l10n_overlays/test_attributes.html] +[l10n_overlays/test_functional_children.html] +[l10n_overlays/test_text_children.html] +[l10n_overlays/test_extra_text_markup.html] +[l10n_overlays/test_l10n_overlays.xhtml] +[l10n_overlays/test_same_id.html] +[l10n_overlays/test_same_id_args.html] +[l10n_overlays/test_title.html] + +[l10n_mutations/test_append_content_post_dcl.html] +[l10n_mutations/test_append_content_pre_dcl.html] +[l10n_mutations/test_append_fragment_post_dcl.html] +[l10n_mutations/test_disconnectedRoot_webcomponent.html] +[l10n_mutations/test_set_attributes.html] +[l10n_mutations/test_pause_observing.html] +[l10n_mutations/test_template.html] +[l10n_mutations/test_remove_element.html] +[l10n_mutations/test_remove_fragment.html] + +[dom_localization/test_attr_sanitized.html] +[dom_localization/test_getAttributes.html] +[dom_localization/test_setAttributes.html] +[dom_localization/test_translateElements.html] +[dom_localization/test_translateFragment.html] +[dom_localization/test_connectRoot.html] +[dom_localization/test_connectRoot_webcomponent.html] +[dom_localization/test_disconnectRoot.html] +[dom_localization/test_repeated_l10nid.html] +[dom_localization/test_translateRoots.html] +[dom_localization/test_l10n_mutations.html] +[dom_localization/test_overlay.html] +[dom_localization/test_overlay_repeated.html] +[dom_localization/test_overlay_missing_all.html] +[dom_localization/test_overlay_missing_children.html] +[dom_localization/test_overlay_sanitized.html] +[dom_localization/test_domloc.xhtml] + + +[document_l10n/test_docl10n.xhtml] +[document_l10n/test_docl10n.html] +[document_l10n/test_docl10n_sync.html] +[document_l10n/test_docl10n_ready_rejected.html] +[document_l10n/test_docl10n_removeResourceIds.html] +[document_l10n/test_docl10n_lazy.html] +[document_l10n/test_connectRoot_webcomponent.html] +[document_l10n/test_connectRoot_webcomponent_lazy.html] +[document_l10n/test_telemetry.html] diff --git a/dom/l10n/tests/mochitest/document_l10n/README.txt b/dom/l10n/tests/mochitest/document_l10n/README.txt new file mode 100644 index 0000000000..b798a5039a --- /dev/null +++ b/dom/l10n/tests/mochitest/document_l10n/README.txt @@ -0,0 +1,3 @@ +Tests in this directory cover support for DocumentL10n +WebIDL API across different use cases such as +processes, principals and so on. diff --git a/dom/l10n/tests/mochitest/document_l10n/non-system-principal/README.txt b/dom/l10n/tests/mochitest/document_l10n/non-system-principal/README.txt new file mode 100644 index 0000000000..d0cc074166 --- /dev/null +++ b/dom/l10n/tests/mochitest/document_l10n/non-system-principal/README.txt @@ -0,0 +1,3 @@ +Tests in this directory cover the functionality +of DocumentL10n WebIDL API in non-system-principal +scenario. diff --git a/dom/l10n/tests/mochitest/document_l10n/non-system-principal/browser_resource_uri.js b/dom/l10n/tests/mochitest/document_l10n/non-system-principal/browser_resource_uri.js new file mode 100644 index 0000000000..a658e88bec --- /dev/null +++ b/dom/l10n/tests/mochitest/document_l10n/non-system-principal/browser_resource_uri.js @@ -0,0 +1,109 @@ +let uri = + "chrome://mochitests/content/browser/dom/l10n/tests/mochitest//document_l10n/non-system-principal/"; +let protocol = Services.io + .getProtocolHandler("resource") + .QueryInterface(Ci.nsIResProtocolHandler); + +protocol.setSubstitution("l10n-test", Services.io.newURI(uri)); + +// Since we want the mock source to work with all locales, we're going +// to register it for currently used locales, and we'll put the path that +// doesn't use the `{locale}` component to make it work irrelevant of +// what locale the mochitest is running in. +// +// Notice: we're using a `chrome://` protocol here only for convenience reasons. +// Real sources should use `resource://` protocol. +let locales = Services.locale.appLocalesAsBCP47; + +// This source is actually using a real `FileSource` instead of a mocked one, +// because we want to test that fetching real I/O out of the `uri` works in non-system-principal. +let source = new L10nFileSource("test", "app", locales, `${uri}localization/`); +L10nRegistry.getInstance().registerSources([source]); + +registerCleanupFunction(() => { + protocol.setSubstitution("l10n-test", null); + L10nRegistry.getInstance().removeSources(["test"]); + SpecialPowers.pushPrefEnv({ + set: [["dom.ipc.processPrelaunch.enabled", true]], + }); +}); + +const kChildPage = getRootDirectory(gTestPath) + "test.html"; + +const kAboutPagesRegistered = Promise.all([ + BrowserTestUtils.registerAboutPage( + registerCleanupFunction, + "test-about-l10n-child", + kChildPage, + Ci.nsIAboutModule.URI_MUST_LOAD_IN_CHILD | + Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT | + Ci.nsIAboutModule.ALLOW_SCRIPT + ), +]); + +add_task(async () => { + // Bug 1640333 - windows fails (sometimes) to ever get document.l10n.ready + // if e10s process caching is enabled + await SpecialPowers.pushPrefEnv({ + set: [ + ["dom.ipc.processPrelaunch.enabled", false], + ["dom.security.skip_about_page_has_csp_assert", true], + ], + }); + await kAboutPagesRegistered; + await BrowserTestUtils.withNewTab( + "about:test-about-l10n-child", + async browser => { + await SpecialPowers.spawn(browser, [], async function () { + let document = content.document; + let window = document.defaultView; + + await document.testsReadyPromise; + + let principal = SpecialPowers.wrap(document).nodePrincipal; + is( + principal.spec, + "about:test-about-l10n-child", + "correct content principal" + ); + + let desc = document.getElementById("main-desc"); + + // We can test here for a particular value because we're + // using a mock file source which is locale independent. + // + // If you're writing a test that verifies that a UI + // widget got real localization, you should not rely on + // the particular value, but rather on the content not + // being empty (to keep the test pass in non-en-US locales). + is(desc.textContent, "This is a mock page title"); + + // Test for l10n.getAttributes + let label = document.getElementById("label1"); + let l10nArgs = document.l10n.getAttributes(label); + is(l10nArgs.id, "subtitle"); + is(l10nArgs.args.name, "Firefox"); + + // Test for manual value formatting + let customMsg = document.getElementById("customMessage").textContent; + is(customMsg, "This is a custom message formatted from JS."); + + // Since we applied the `data-l10n-id` attribute + // on `label` in this microtask, we have to wait for + // the next paint to verify that the MutationObserver + // applied the translation. + await new Promise(resolve => { + let verifyL10n = () => { + if (!label.textContent.includes("Firefox")) { + window.requestAnimationFrame(verifyL10n); + } else { + resolve(); + } + }; + + window.requestAnimationFrame(verifyL10n); + }); + }); + } + ); +}); diff --git a/dom/l10n/tests/mochitest/document_l10n/non-system-principal/localization/test.ftl b/dom/l10n/tests/mochitest/document_l10n/non-system-principal/localization/test.ftl new file mode 100644 index 0000000000..a5da5a8f00 --- /dev/null +++ b/dom/l10n/tests/mochitest/document_l10n/non-system-principal/localization/test.ftl @@ -0,0 +1,4 @@ +page-title = This is a mock page title +subtitle = This is a label for { $name } + +custom-message = This is a custom message formatted from JS. diff --git a/dom/l10n/tests/mochitest/document_l10n/non-system-principal/test.html b/dom/l10n/tests/mochitest/document_l10n/non-system-principal/test.html new file mode 100644 index 0000000000..5d91f3da46 --- /dev/null +++ b/dom/l10n/tests/mochitest/document_l10n/non-system-principal/test.html @@ -0,0 +1,37 @@ + + + + + Test DocumentL10n in HTML environment + + + + +

+ +

+

+ + diff --git a/dom/l10n/tests/mochitest/document_l10n/test_connectRoot_webcomponent.html b/dom/l10n/tests/mochitest/document_l10n/test_connectRoot_webcomponent.html new file mode 100644 index 0000000000..3f2def3547 --- /dev/null +++ b/dom/l10n/tests/mochitest/document_l10n/test_connectRoot_webcomponent.html @@ -0,0 +1,90 @@ + + + + + Test Web Component connecting into Document's l10n + + + + + + + + + + + + diff --git a/dom/l10n/tests/mochitest/document_l10n/test_connectRoot_webcomponent_lazy.html b/dom/l10n/tests/mochitest/document_l10n/test_connectRoot_webcomponent_lazy.html new file mode 100644 index 0000000000..b74bbc00c8 --- /dev/null +++ b/dom/l10n/tests/mochitest/document_l10n/test_connectRoot_webcomponent_lazy.html @@ -0,0 +1,98 @@ + + + + + Test Web Component connecting into Document's l10n + + + + + + + + diff --git a/dom/l10n/tests/mochitest/document_l10n/test_docl10n.html b/dom/l10n/tests/mochitest/document_l10n/test_docl10n.html new file mode 100644 index 0000000000..12ff623f5c --- /dev/null +++ b/dom/l10n/tests/mochitest/document_l10n/test_docl10n.html @@ -0,0 +1,66 @@ + + + + + Test DocumentL10n in HTML environment + + + + + + +

+ +

+ + diff --git a/dom/l10n/tests/mochitest/document_l10n/test_docl10n.xhtml b/dom/l10n/tests/mochitest/document_l10n/test_docl10n.xhtml new file mode 100644 index 0000000000..2d51d8689e --- /dev/null +++ b/dom/l10n/tests/mochitest/document_l10n/test_docl10n.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + Test DocumentL10n in HTML environment + + + + + + +

+ +

+ + diff --git a/dom/l10n/tests/mochitest/document_l10n/test_docl10n_lazy.html b/dom/l10n/tests/mochitest/document_l10n/test_docl10n_lazy.html new file mode 100644 index 0000000000..6c3ddb73ed --- /dev/null +++ b/dom/l10n/tests/mochitest/document_l10n/test_docl10n_lazy.html @@ -0,0 +1,44 @@ + + + + + Test Lazy DocumentL10n in HTML environment + + + + + +

+ +

+ + diff --git a/dom/l10n/tests/mochitest/document_l10n/test_docl10n_ready_rejected.html b/dom/l10n/tests/mochitest/document_l10n/test_docl10n_ready_rejected.html new file mode 100644 index 0000000000..63e18f802c --- /dev/null +++ b/dom/l10n/tests/mochitest/document_l10n/test_docl10n_ready_rejected.html @@ -0,0 +1,29 @@ + + + + + Test mozIDOMLocalization.ready rejected state + + + + + + +

+ + diff --git a/dom/l10n/tests/mochitest/document_l10n/test_docl10n_removeResourceIds.html b/dom/l10n/tests/mochitest/document_l10n/test_docl10n_removeResourceIds.html new file mode 100644 index 0000000000..8ccaa04614 --- /dev/null +++ b/dom/l10n/tests/mochitest/document_l10n/test_docl10n_removeResourceIds.html @@ -0,0 +1,59 @@ + + + + + Test DocumentL10n::RemoveResourceIds + + + + + + + + + diff --git a/dom/l10n/tests/mochitest/document_l10n/test_docl10n_sync.html b/dom/l10n/tests/mochitest/document_l10n/test_docl10n_sync.html new file mode 100644 index 0000000000..ea44d1afe1 --- /dev/null +++ b/dom/l10n/tests/mochitest/document_l10n/test_docl10n_sync.html @@ -0,0 +1,54 @@ + + + + + Test DocumentL10n in HTML environment + + + + + + +

+ +

+ + diff --git a/dom/l10n/tests/mochitest/document_l10n/test_telemetry.html b/dom/l10n/tests/mochitest/document_l10n/test_telemetry.html new file mode 100644 index 0000000000..b528ebc7ea --- /dev/null +++ b/dom/l10n/tests/mochitest/document_l10n/test_telemetry.html @@ -0,0 +1,83 @@ + + + + + Test DocumentL10n Telemetry + + + + + + + diff --git a/dom/l10n/tests/mochitest/document_l10n/test_unpriv_iframe.html b/dom/l10n/tests/mochitest/document_l10n/test_unpriv_iframe.html new file mode 100644 index 0000000000..4f4b29c500 --- /dev/null +++ b/dom/l10n/tests/mochitest/document_l10n/test_unpriv_iframe.html @@ -0,0 +1,26 @@ + + + + + Ensure unprivilaged document cannot access document.l10n in an iframe + + + + + + + + + diff --git a/dom/l10n/tests/mochitest/dom_localization/test_attr_sanitized.html b/dom/l10n/tests/mochitest/dom_localization/test_attr_sanitized.html new file mode 100644 index 0000000000..a9244c9891 --- /dev/null +++ b/dom/l10n/tests/mochitest/dom_localization/test_attr_sanitized.html @@ -0,0 +1,49 @@ + + + + + Test DOMLocalization's attr sanitization functionality + + + + + +

+

+ + diff --git a/dom/l10n/tests/mochitest/dom_localization/test_connectRoot.html b/dom/l10n/tests/mochitest/dom_localization/test_connectRoot.html new file mode 100644 index 0000000000..83b83757f1 --- /dev/null +++ b/dom/l10n/tests/mochitest/dom_localization/test_connectRoot.html @@ -0,0 +1,45 @@ + + + + + Test DOMLocalization.prototype.connectRoot + + + + + +

+ + diff --git a/dom/l10n/tests/mochitest/dom_localization/test_connectRoot_webcomponent.html b/dom/l10n/tests/mochitest/dom_localization/test_connectRoot_webcomponent.html new file mode 100644 index 0000000000..1254bd814f --- /dev/null +++ b/dom/l10n/tests/mochitest/dom_localization/test_connectRoot_webcomponent.html @@ -0,0 +1,72 @@ + + + + + Test DOMLocalization.prototype.connectRoot with Web Components + + + + + + + + + + diff --git a/dom/l10n/tests/mochitest/dom_localization/test_disconnectRoot.html b/dom/l10n/tests/mochitest/dom_localization/test_disconnectRoot.html new file mode 100644 index 0000000000..fd7344c88e --- /dev/null +++ b/dom/l10n/tests/mochitest/dom_localization/test_disconnectRoot.html @@ -0,0 +1,60 @@ + + + + + Test DOMLocalization.prototype.disconnectRoot + + + + + +

+ + diff --git a/dom/l10n/tests/mochitest/dom_localization/test_domloc.xhtml b/dom/l10n/tests/mochitest/dom_localization/test_domloc.xhtml new file mode 100644 index 0000000000..a4d4fcc506 --- /dev/null +++ b/dom/l10n/tests/mochitest/dom_localization/test_domloc.xhtml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + diff --git a/dom/l10n/tests/mochitest/dom_localization/test_getAttributes.html b/dom/l10n/tests/mochitest/dom_localization/test_getAttributes.html new file mode 100644 index 0000000000..11996d132a --- /dev/null +++ b/dom/l10n/tests/mochitest/dom_localization/test_getAttributes.html @@ -0,0 +1,49 @@ + + + + + Test DOMLocalization.prototype.getAttributes + + + + + +

+

+

+ + diff --git a/dom/l10n/tests/mochitest/dom_localization/test_l10n_mutations.html b/dom/l10n/tests/mochitest/dom_localization/test_l10n_mutations.html new file mode 100644 index 0000000000..278baa15dd --- /dev/null +++ b/dom/l10n/tests/mochitest/dom_localization/test_l10n_mutations.html @@ -0,0 +1,57 @@ + + + + + Test DOMLocalization's MutationObserver + + + + + +

+

+
+ + diff --git a/dom/l10n/tests/mochitest/dom_localization/test_overlay.html b/dom/l10n/tests/mochitest/dom_localization/test_overlay.html new file mode 100644 index 0000000000..2c8c219bb2 --- /dev/null +++ b/dom/l10n/tests/mochitest/dom_localization/test_overlay.html @@ -0,0 +1,60 @@ + + + + + Test DOMLocalization's DOMOverlay functionality + + + + + +

+

+ +

+ + diff --git a/dom/l10n/tests/mochitest/dom_localization/test_overlay_missing_all.html b/dom/l10n/tests/mochitest/dom_localization/test_overlay_missing_all.html new file mode 100644 index 0000000000..c6f285aa38 --- /dev/null +++ b/dom/l10n/tests/mochitest/dom_localization/test_overlay_missing_all.html @@ -0,0 +1,37 @@ + + + + + Test DOMLocalization's DOMOverlay functionality + + + + + +

+ + + +

+ + diff --git a/dom/l10n/tests/mochitest/dom_localization/test_overlay_missing_children.html b/dom/l10n/tests/mochitest/dom_localization/test_overlay_missing_children.html new file mode 100644 index 0000000000..9e4fec1ce2 --- /dev/null +++ b/dom/l10n/tests/mochitest/dom_localization/test_overlay_missing_children.html @@ -0,0 +1,53 @@ + + + + + Test DOMLocalization's DOMOverlay functionality + + + + + +

+ + + +

+ + diff --git a/dom/l10n/tests/mochitest/dom_localization/test_overlay_repeated.html b/dom/l10n/tests/mochitest/dom_localization/test_overlay_repeated.html new file mode 100644 index 0000000000..a169c27fa0 --- /dev/null +++ b/dom/l10n/tests/mochitest/dom_localization/test_overlay_repeated.html @@ -0,0 +1,50 @@ + + + + + Test DOMLocalization's DOMOverlay functionality + + + + + +

+ + +

+ + diff --git a/dom/l10n/tests/mochitest/dom_localization/test_overlay_sanitized.html b/dom/l10n/tests/mochitest/dom_localization/test_overlay_sanitized.html new file mode 100644 index 0000000000..fcc201edb6 --- /dev/null +++ b/dom/l10n/tests/mochitest/dom_localization/test_overlay_sanitized.html @@ -0,0 +1,52 @@ + + + + + Test DOMLocalization's DOMOverlay functionality + + + + + + + + + diff --git a/dom/l10n/tests/mochitest/dom_localization/test_repeated_l10nid.html b/dom/l10n/tests/mochitest/dom_localization/test_repeated_l10nid.html new file mode 100644 index 0000000000..64d585f0a0 --- /dev/null +++ b/dom/l10n/tests/mochitest/dom_localization/test_repeated_l10nid.html @@ -0,0 +1,60 @@ + + + + + Test DOMLocalization's matching l10nIds functionality + + + + + +

+

+ +

+ +

+ +

+ +

+ + diff --git a/dom/l10n/tests/mochitest/dom_localization/test_setAttributes.html b/dom/l10n/tests/mochitest/dom_localization/test_setAttributes.html new file mode 100644 index 0000000000..508a15dcd3 --- /dev/null +++ b/dom/l10n/tests/mochitest/dom_localization/test_setAttributes.html @@ -0,0 +1,79 @@ + + + + + Test DOMLocalization.prototype.setAttributes and DOMLocalization.prototype.setArgs + + + + + +

+ + diff --git a/dom/l10n/tests/mochitest/dom_localization/test_translateElements.html b/dom/l10n/tests/mochitest/dom_localization/test_translateElements.html new file mode 100644 index 0000000000..7893309ce4 --- /dev/null +++ b/dom/l10n/tests/mochitest/dom_localization/test_translateElements.html @@ -0,0 +1,47 @@ + + + + + Test DOMLocalization.prototype.translateElements + + + + + +

+ + + diff --git a/dom/l10n/tests/mochitest/dom_localization/test_translateFragment.html b/dom/l10n/tests/mochitest/dom_localization/test_translateFragment.html new file mode 100644 index 0000000000..c5ccfd996a --- /dev/null +++ b/dom/l10n/tests/mochitest/dom_localization/test_translateFragment.html @@ -0,0 +1,48 @@ + + + + + Test DOMLocalization.prototype.translateFragment + + + + + +

+ + diff --git a/dom/l10n/tests/mochitest/dom_localization/test_translateRoots.html b/dom/l10n/tests/mochitest/dom_localization/test_translateRoots.html new file mode 100644 index 0000000000..58bfb044b0 --- /dev/null +++ b/dom/l10n/tests/mochitest/dom_localization/test_translateRoots.html @@ -0,0 +1,56 @@ + + + + + Test DOMLocalization.prototype.translateRoots + + + + + +
+

+
+
+

+
+ + diff --git a/dom/l10n/tests/mochitest/l10n_mutations/test_append_content_post_dcl.html b/dom/l10n/tests/mochitest/l10n_mutations/test_append_content_post_dcl.html new file mode 100644 index 0000000000..e3a9819728 --- /dev/null +++ b/dom/l10n/tests/mochitest/l10n_mutations/test_append_content_post_dcl.html @@ -0,0 +1,30 @@ + + + + + Test L10n Mutations for ContentAppended after DOMContentLoaded + + + + + + + + diff --git a/dom/l10n/tests/mochitest/l10n_mutations/test_append_content_pre_dcl.html b/dom/l10n/tests/mochitest/l10n_mutations/test_append_content_pre_dcl.html new file mode 100644 index 0000000000..825464e7b8 --- /dev/null +++ b/dom/l10n/tests/mochitest/l10n_mutations/test_append_content_pre_dcl.html @@ -0,0 +1,28 @@ + + + + + Test L10n Mutations for ContentAppended before DOMContentLoaded + + + + + + + + diff --git a/dom/l10n/tests/mochitest/l10n_mutations/test_append_fragment_post_dcl.html b/dom/l10n/tests/mochitest/l10n_mutations/test_append_fragment_post_dcl.html new file mode 100644 index 0000000000..8efb3203c6 --- /dev/null +++ b/dom/l10n/tests/mochitest/l10n_mutations/test_append_fragment_post_dcl.html @@ -0,0 +1,39 @@ + + + + + Test L10n Mutations for appending a fragment after DOMContentLoaded + + + + + + + + diff --git a/dom/l10n/tests/mochitest/l10n_mutations/test_disconnectedRoot_webcomponent.html b/dom/l10n/tests/mochitest/l10n_mutations/test_disconnectedRoot_webcomponent.html new file mode 100644 index 0000000000..bb9d9fc24d --- /dev/null +++ b/dom/l10n/tests/mochitest/l10n_mutations/test_disconnectedRoot_webcomponent.html @@ -0,0 +1,148 @@ + + + + + Test DOMLocalization.prototype.connectRoot with Web Components + + + + + + +

+ + + + + diff --git a/dom/l10n/tests/mochitest/l10n_mutations/test_pause_observing.html b/dom/l10n/tests/mochitest/l10n_mutations/test_pause_observing.html new file mode 100644 index 0000000000..d225153418 --- /dev/null +++ b/dom/l10n/tests/mochitest/l10n_mutations/test_pause_observing.html @@ -0,0 +1,44 @@ + + + + + Test L10n Mutations for Pause/Resume Observing + + + + + + + + diff --git a/dom/l10n/tests/mochitest/l10n_mutations/test_remove_element.html b/dom/l10n/tests/mochitest/l10n_mutations/test_remove_element.html new file mode 100644 index 0000000000..347e858d52 --- /dev/null +++ b/dom/l10n/tests/mochitest/l10n_mutations/test_remove_element.html @@ -0,0 +1,68 @@ + + + + + Test L10n Mutations for removing element + + + + + + + + diff --git a/dom/l10n/tests/mochitest/l10n_mutations/test_remove_fragment.html b/dom/l10n/tests/mochitest/l10n_mutations/test_remove_fragment.html new file mode 100644 index 0000000000..4f4d0fe1d8 --- /dev/null +++ b/dom/l10n/tests/mochitest/l10n_mutations/test_remove_fragment.html @@ -0,0 +1,67 @@ + + + + + Test L10n Mutations for removing fragment + + + + + + + + diff --git a/dom/l10n/tests/mochitest/l10n_mutations/test_set_attributes.html b/dom/l10n/tests/mochitest/l10n_mutations/test_set_attributes.html new file mode 100644 index 0000000000..762353a06c --- /dev/null +++ b/dom/l10n/tests/mochitest/l10n_mutations/test_set_attributes.html @@ -0,0 +1,37 @@ + + + + + Test L10n Mutations for AttributeChange after DOMContentLoaded + + + + + + + +
+
+ + diff --git a/dom/l10n/tests/mochitest/l10n_mutations/test_template.html b/dom/l10n/tests/mochitest/l10n_mutations/test_template.html new file mode 100644 index 0000000000..d02ecfcd4d --- /dev/null +++ b/dom/l10n/tests/mochitest/l10n_mutations/test_template.html @@ -0,0 +1,37 @@ + + + + + Test L10n Mutations in Template elements + + + + + + + + + diff --git a/dom/l10n/tests/mochitest/l10n_overlays/test_attributes.html b/dom/l10n/tests/mochitest/l10n_overlays/test_attributes.html new file mode 100644 index 0000000000..3d1f6048b2 --- /dev/null +++ b/dom/l10n/tests/mochitest/l10n_overlays/test_attributes.html @@ -0,0 +1,86 @@ + + + + + Test L10nOverlays Top-level attributes + + + + + + + diff --git a/dom/l10n/tests/mochitest/l10n_overlays/test_extra_text_markup.html b/dom/l10n/tests/mochitest/l10n_overlays/test_extra_text_markup.html new file mode 100644 index 0000000000..5f60599dfc --- /dev/null +++ b/dom/l10n/tests/mochitest/l10n_overlays/test_extra_text_markup.html @@ -0,0 +1,136 @@ + + + + + Test L10nOverlays Localized text markup + + + + + + + diff --git a/dom/l10n/tests/mochitest/l10n_overlays/test_functional_children.html b/dom/l10n/tests/mochitest/l10n_overlays/test_functional_children.html new file mode 100644 index 0000000000..dba5b6e633 --- /dev/null +++ b/dom/l10n/tests/mochitest/l10n_overlays/test_functional_children.html @@ -0,0 +1,344 @@ + + + + + Test L10nOverlays functional children test + + + + + + + diff --git a/dom/l10n/tests/mochitest/l10n_overlays/test_l10n_overlays.xhtml b/dom/l10n/tests/mochitest/l10n_overlays/test_l10n_overlays.xhtml new file mode 100644 index 0000000000..494958c573 --- /dev/null +++ b/dom/l10n/tests/mochitest/l10n_overlays/test_l10n_overlays.xhtml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/dom/l10n/tests/mochitest/l10n_overlays/test_same_id.html b/dom/l10n/tests/mochitest/l10n_overlays/test_same_id.html new file mode 100644 index 0000000000..ecaefbd68d --- /dev/null +++ b/dom/l10n/tests/mochitest/l10n_overlays/test_same_id.html @@ -0,0 +1,57 @@ + + + + + Test Amount of mutations generated from DOM Overlays + + + + + + + + + diff --git a/dom/l10n/tests/mochitest/l10n_overlays/test_same_id_args.html b/dom/l10n/tests/mochitest/l10n_overlays/test_same_id_args.html new file mode 100644 index 0000000000..e43c394970 --- /dev/null +++ b/dom/l10n/tests/mochitest/l10n_overlays/test_same_id_args.html @@ -0,0 +1,57 @@ + + + + + Test Amount of mutations generated from DOM Overlays + + + + + + + + + diff --git a/dom/l10n/tests/mochitest/l10n_overlays/test_text_children.html b/dom/l10n/tests/mochitest/l10n_overlays/test_text_children.html new file mode 100644 index 0000000000..1c2fab7ade --- /dev/null +++ b/dom/l10n/tests/mochitest/l10n_overlays/test_text_children.html @@ -0,0 +1,74 @@ + + + + + Test L10nOverlays Text-semantic argument elements + + + + + + + diff --git a/dom/l10n/tests/mochitest/l10n_overlays/test_title.html b/dom/l10n/tests/mochitest/l10n_overlays/test_title.html new file mode 100644 index 0000000000..4571589b8e --- /dev/null +++ b/dom/l10n/tests/mochitest/l10n_overlays/test_title.html @@ -0,0 +1,60 @@ + + + + + Test L10nOverlays Special treatment of the title element + + + + + + + diff --git a/dom/l10n/tests/mochitest/mochitest.ini b/dom/l10n/tests/mochitest/mochitest.ini new file mode 100644 index 0000000000..82af57c47c --- /dev/null +++ b/dom/l10n/tests/mochitest/mochitest.ini @@ -0,0 +1 @@ +[document_l10n/test_unpriv_iframe.html] -- cgit v1.2.3