Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/inspector/console/console-log-custom-elements.html |
| diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-log-custom-elements.html b/third_party/WebKit/LayoutTests/inspector/console/console-log-custom-elements.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..01903433bed18fe7e6498b2c2cc0e5c0c8265bd2 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/inspector/console/console-log-custom-elements.html |
| @@ -0,0 +1,58 @@ |
| +<html> |
| +<head> |
| +<script src="../../http/tests/inspector/inspector-test.js"></script> |
| +<script src="../../http/tests/inspector/console-test.js"></script> |
| +</head> |
| + |
| +<body onload="runTest()"> |
| + |
| +<foo-bar></foo-bar> |
| +<foo-bar2></foo-bar2> |
| +<p> |
| +Tests that logging custom elements uses proper formatting. |
|
kozy
2016/06/08 20:58:04
Usually we put test script in head tag before body
luoe
2016/06/09 19:27:44
Done.
|
| +</p> |
| + |
| +<script> |
| +function registerNonElement() |
| +{ |
| + var nonElementProto = { |
| + createdCallback: function() |
| + { |
| + console.dir(this); |
| + } |
| + }; |
| + var nonElementOptions = { prototype: nonElementProto }; |
| + document.registerElement("foo-bar", nonElementOptions); |
| +} |
| + |
| +function registerElement() |
| +{ |
| + var elementProto = Object.create(HTMLElement.prototype); |
| + elementProto.createdCallback = function() |
| + { |
| + console.dir(this); |
| + }; |
| + var elementOptions = { prototype: elementProto }; |
| + document.registerElement("foo-bar2", elementOptions); |
| +} |
| + |
| +function test() |
| +{ |
| + InspectorTest.waitUntilMessageReceived(step1); |
| + InspectorTest.evaluateInPage("registerNonElement();"); |
| + |
| + function step1() |
| + { |
| + InspectorTest.waitUntilMessageReceived(step2); |
| + InspectorTest.evaluateInPage("registerElement();"); |
| + } |
| + |
| + function step2() |
| + { |
| + InspectorTest.dumpConsoleMessages(); |
| + InspectorTest.completeTest(); |
| + } |
| +} |
| +</script> |
| +</body> |
| +</html> |