Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Unified Diff: third_party/WebKit/LayoutTests/inspector/console/console-log-custom-elements.html

Issue 2056433002: DevTools: properly format custom elements without nodenames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698