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 --- .../embedded-content/bfcache/embedded-html.html | 10 +++++ .../embedded-content/bfcache/embedded-img.html | 10 +++++ .../embedded-content/bfcache/embedded-js.html | 11 ++++++ .../embedded-content/bfcache/embedded-mp4.html | 10 +++++ .../bfcache/embedded-not-found.html | 10 +++++ .../bfcache/embedded-type-only.html | 10 +++++ .../embedded-content/bfcache/resources/common.js | 46 ++++++++++++++++++++++ 7 files changed, 107 insertions(+) create mode 100644 testing/web-platform/tests/html/semantics/embedded-content/bfcache/embedded-html.html create mode 100644 testing/web-platform/tests/html/semantics/embedded-content/bfcache/embedded-img.html create mode 100644 testing/web-platform/tests/html/semantics/embedded-content/bfcache/embedded-js.html create mode 100644 testing/web-platform/tests/html/semantics/embedded-content/bfcache/embedded-mp4.html create mode 100644 testing/web-platform/tests/html/semantics/embedded-content/bfcache/embedded-not-found.html create mode 100644 testing/web-platform/tests/html/semantics/embedded-content/bfcache/embedded-type-only.html create mode 100644 testing/web-platform/tests/html/semantics/embedded-content/bfcache/resources/common.js (limited to 'testing/web-platform/tests/html/semantics/embedded-content/bfcache') diff --git a/testing/web-platform/tests/html/semantics/embedded-content/bfcache/embedded-html.html b/testing/web-platform/tests/html/semantics/embedded-content/bfcache/embedded-html.html new file mode 100644 index 0000000000..0808538337 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/embedded-content/bfcache/embedded-html.html @@ -0,0 +1,10 @@ + + + + + + + diff --git a/testing/web-platform/tests/html/semantics/embedded-content/bfcache/embedded-img.html b/testing/web-platform/tests/html/semantics/embedded-content/bfcache/embedded-img.html new file mode 100644 index 0000000000..7e9d713c0a --- /dev/null +++ b/testing/web-platform/tests/html/semantics/embedded-content/bfcache/embedded-img.html @@ -0,0 +1,10 @@ + + + + + + + diff --git a/testing/web-platform/tests/html/semantics/embedded-content/bfcache/embedded-js.html b/testing/web-platform/tests/html/semantics/embedded-content/bfcache/embedded-js.html new file mode 100644 index 0000000000..c3b027563d --- /dev/null +++ b/testing/web-platform/tests/html/semantics/embedded-content/bfcache/embedded-js.html @@ -0,0 +1,11 @@ + + + + + + + diff --git a/testing/web-platform/tests/html/semantics/embedded-content/bfcache/embedded-mp4.html b/testing/web-platform/tests/html/semantics/embedded-content/bfcache/embedded-mp4.html new file mode 100644 index 0000000000..fde560e5be --- /dev/null +++ b/testing/web-platform/tests/html/semantics/embedded-content/bfcache/embedded-mp4.html @@ -0,0 +1,10 @@ + + + + + + + diff --git a/testing/web-platform/tests/html/semantics/embedded-content/bfcache/embedded-not-found.html b/testing/web-platform/tests/html/semantics/embedded-content/bfcache/embedded-not-found.html new file mode 100644 index 0000000000..0b56b5eadc --- /dev/null +++ b/testing/web-platform/tests/html/semantics/embedded-content/bfcache/embedded-not-found.html @@ -0,0 +1,10 @@ + + + + + + + diff --git a/testing/web-platform/tests/html/semantics/embedded-content/bfcache/embedded-type-only.html b/testing/web-platform/tests/html/semantics/embedded-content/bfcache/embedded-type-only.html new file mode 100644 index 0000000000..90c9d3311c --- /dev/null +++ b/testing/web-platform/tests/html/semantics/embedded-content/bfcache/embedded-type-only.html @@ -0,0 +1,10 @@ + + + + + + + diff --git a/testing/web-platform/tests/html/semantics/embedded-content/bfcache/resources/common.js b/testing/web-platform/tests/html/semantics/embedded-content/bfcache/resources/common.js new file mode 100644 index 0000000000..5bb9642a83 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/embedded-content/bfcache/resources/common.js @@ -0,0 +1,46 @@ +'use strict'; + +async function loadBfCacheTestHelperResources() { + await loadScript('/common/utils.js'); + await loadScript('/common/dispatcher/dispatcher.js'); + await loadScript( + '/html/browsers/browsing-the-web/back-forward-cache/resources/helper.sub.js'); +} +await loadBfCacheTestHelperResources(); + +// Runs BFCache tests for embed elements, specifically and . +// 1. Attaches the target element to first page. +// 2. Navigates away, then back via bfcache if this case is supported by the +// browser. +// @param {Object} testCase - The target element's attributes to test with. +export function runBfcacheTestForEmbeds(testCase) { + assert_implements(runBfcacheTest, '`runBfcacheTest()` is unavailable.'); + assert_implements(originSameOrigin, '`originSameOrigin` is unavailable.'); + + const tags = [ + {'name': 'embed', 'srcAttr': 'src'}, + {'name': 'object', 'srcAttr': 'data'}, + ]; + for (const tag of tags) { + runBfcacheTest( + { + targetOrigin: originSameOrigin, + shouldBeCached: true, + funcBeforeNavigation: (tag, attrs) => { + let e = document.createElement(tag.name); + // Only sets defined attributes to match the intended test behavior + // like embedded-type-only.html test. + if ('type' in attrs) { + e.type = attrs.type; + } + if ('src' in attrs) { + e[tag.srcAttr] = attrs.src; + } + document.body.append(e); + }, + argsBeforeNavigation: [tag, testCase] + }, + `Page with <${tag.name} ` + + `type=${testCase.type} ${tag.srcAttr}=${testCase.src}>`); + } +} -- cgit v1.2.3