Commit 997db2fc authored by Alfonso Castaño's avatar Alfonso Castaño Committed by Commit Bot

Tests for Node objects description in Blink

This CL test the description generated for the different types of Nodes.

Bug: chromium:1048143,chromium:1127115
Change-Id: Iedd575129cdb7a34570e0cbb96d52a91d13897ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2515680
Commit-Queue: Alfonso Castaño <alcastano@google.com>
Reviewed-by: default avatarSigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824022}
parent 74f6cdc9
...@@ -6243,3 +6243,7 @@ crbug.com/1145424 [ Win ] http/tests/devtools/sources/debugger-ui/reveal-executi ...@@ -6243,3 +6243,7 @@ crbug.com/1145424 [ Win ] http/tests/devtools/sources/debugger-ui/reveal-executi
# DevTools roll # DevTools roll
crbug.com/1011811 http/tests/devtools/tracing/timeline-misc/timeline-user-timings.js [ Skip ] crbug.com/1011811 http/tests/devtools/tracing/timeline-misc/timeline-user-timings.js [ Skip ]
crbug.com/1011811 http/tests/devtools/tracing/timeline-misc/timeline-aggregated-details.js [ Skip ] crbug.com/1011811 http/tests/devtools/tracing/timeline-misc/timeline-aggregated-details.js [ Skip ]
# Disabled until CL with fix gets merged https://chromium-review.googlesource.com/c/chromium/src/+/2504259
crbug.com/1127115 inspector-protocol/runtime/runtime-console-log-node-letter-case.js [ Failure ]
crbug.com/1127115 inspector-protocol/runtime/runtime-console-log-node-document-type.js [ Failure ]
Test description generation for custom elements.
{
className : HTMLElement
description : word-count
objectId : <string>
subtype : node
type : object
}
{
className : HTMLElement
description : word-count#x_id
objectId : <string>
subtype : node
type : object
}
{
className : HTMLElement
description : word-count#x_id.x_class
objectId : <string>
subtype : node
type : object
}
{
className : HTMLElement
description : word-count#x_id.x_class1.x_class2
objectId : <string>
subtype : node
type : object
}
(async function testRemoteObjects(testRunner) {
const {dp} = await testRunner.startBlank('Test description generation for custom elements.');
dp.Runtime.enable();
const result0 = await dp.Runtime.evaluate({ expression:
`class WordCount extends HTMLParagraphElement {
constructor() { super(); }
};
customElements.define('word-count', WordCount, { extends: 'p' });`
});
const result1 = await dp.Runtime.evaluate({ expression:
`x = document.createElement("word-count"); x`
});
const result2 = await dp.Runtime.evaluate({ expression:
`x.id = "x_id"; x`
});
const result3 = await dp.Runtime.evaluate({ expression:
`x.className = "x_class"; x`
});
const result4 = await dp.Runtime.evaluate({ expression:
`x.className = "x_class1 x_class2"; x`
});
testRunner.log(result1.result.result);
testRunner.log(result2.result.result);
testRunner.log(result3.result.result);
testRunner.log(result4.result.result);
testRunner.completeTest();
});
\ No newline at end of file
Test description generation for DocumentType Nodes.
{
className : DocumentType
description : <!DOCTYPE svg:svg>
objectId : <string>
subtype : node
type : object
}
(async function testRemoteObjects(testRunner) {
const {dp} = await testRunner.startBlank('Test description generation for DocumentType Nodes.');
dp.Runtime.enable();
const result = await dp.Runtime.evaluate({ expression:
`document.implementation.createDocumentType('svg:svg', '-//W3C//DTD SVG 1.1//EN', 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd');`
});
testRunner.log(result.result.result);
testRunner.completeTest();
});
\ No newline at end of file
Test description generation for HTML Nodes.
{
className : HTMLDivElement
description : div
objectId : <string>
subtype : node
type : object
}
{
className : HTMLDivElement
description : div#x_id
objectId : <string>
subtype : node
type : object
}
{
className : HTMLDivElement
description : div#x_id.x_class
objectId : <string>
subtype : node
type : object
}
{
className : HTMLDivElement
description : div#x_id.x_class1.x_class2
objectId : <string>
subtype : node
type : object
}
(async function testRemoteObjects(testRunner) {
const {dp} = await testRunner.startBlank('Test description generation for HTML Nodes.');
dp.Runtime.enable();
const result1 = await dp.Runtime.evaluate({ expression:
`x = document.createElement("div"); x`
});
const result2 = await dp.Runtime.evaluate({ expression:
`x.id = "x_id"; x`
});
const result3 = await dp.Runtime.evaluate({ expression:
`x.className = "x_class"; x`
});
const result4 = await dp.Runtime.evaluate({ expression:
`x.className = "x_class1 x_class2"; x`
});
testRunner.log(result1.result.result);
testRunner.log(result2.result.result);
testRunner.log(result3.result.result);
testRunner.log(result4.result.result);
testRunner.completeTest();
});
\ No newline at end of file
Test right letter case in description of Nodes.
{
className : Element
description : PascalCase
objectId : <string>
subtype : node
type : object
}
{
className : HTMLUnknownElement
description : pascalcase
objectId : <string>
subtype : node
type : object
}
(async function testRemoteObjects(testRunner) {
const {dp} = await testRunner.startBlank('Test right letter case in description of Nodes.');
dp.Runtime.enable();
const result1 = await dp.Runtime.evaluate({ expression:
`new DOMParser().parseFromString('<PascalCase></PascalCase>', 'application/xml').querySelector('PascalCase')`
});
const result2 = await dp.Runtime.evaluate({ expression:
`new DOMParser().parseFromString('<PascalCase></PascalCase>', 'text/html').querySelector('PascalCase')`
});
testRunner.log(result1.result.result);
testRunner.log(result2.result.result);
testRunner.completeTest();
});
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment