mirror of
https://github.com/servo/servo.git
synced 2025-08-09 15:35:34 +01:00
Update web-platform-tests to revision e45156b5e558c062a609356905c83a0258c516e3
This commit is contained in:
parent
9f6005be16
commit
5fcf52d946
199 changed files with 4430 additions and 530 deletions
|
@ -28,7 +28,7 @@ function setupManualShareTestCommon() {
|
|||
// Sets up the page for running manual tests. Automatically creates the
|
||||
// instructions (based on the parameters) and the share button.
|
||||
function setupManualShareTest(expected_share_data) {
|
||||
const {title, text, url} = expected_share_data;
|
||||
const {title, text, url, files} = expected_share_data;
|
||||
let [instruction, list] = setupManualShareTestCommon();
|
||||
let item = document.createElement('li');
|
||||
list.appendChild(item);
|
||||
|
@ -50,6 +50,27 @@ function setupManualShareTest(expected_share_data) {
|
|||
item = document.createElement('li');
|
||||
list.appendChild(item);
|
||||
item.innerText = `url = "${url}"`;
|
||||
if (files) {
|
||||
item = document.createElement('li');
|
||||
list.appendChild(item);
|
||||
item.innerText = `files = ${files.length} file(s)`;
|
||||
for (let file of files) {
|
||||
const div = document.createElement('div');
|
||||
if (file.type.startsWith('text/')) {
|
||||
const reader = new FileReader();
|
||||
reader.onload = () => {
|
||||
div.textContent = reader.result;
|
||||
};
|
||||
reader.readAsText(file);
|
||||
} else if (file.type.startsWith('image/')) {
|
||||
const image = document.createElement('img');
|
||||
image.src = URL.createObjectURL(file);
|
||||
image.alt = file.name;
|
||||
div.appendChild(image);
|
||||
}
|
||||
item.appendChild(div);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setupManualShareTestRequiringCancellation() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue