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

Unified Diff: third_party/WebKit/LayoutTests/imported/wpt/custom-elements/reactions/Document.html

Issue 2477133002: Import wpt@306326cfe973b6c7019c50879ad03b02825c7539 (Closed)
Patch Set: Modify TestExpectations or download new baselines for tests. Created 4 years, 1 month 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/imported/wpt/custom-elements/reactions/Document.html
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/custom-elements/reactions/Document.html b/third_party/WebKit/LayoutTests/imported/wpt/custom-elements/reactions/Document.html
index 0d60f06e15d275e47b1b2c16f92ff06bc708d5fc..98c642bcf264747a453b5fb67c529341d7af659a 100644
--- a/third_party/WebKit/LayoutTests/imported/wpt/custom-elements/reactions/Document.html
+++ b/third_party/WebKit/LayoutTests/imported/wpt/custom-elements/reactions/Document.html
@@ -110,6 +110,45 @@ test_with_window(function (contentWindow, contentDocument) {
assert_array_equals(element.takeLog().types(), ['connected']);
}, 'body on Document must enqueue connectedCallback when inserting a custom element');
+test_with_window(function (contentWindow, contentDocument) {
+ const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+ contentDocument.body.innerHTML = '<custom-element></custom-element>';
+ assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+
+ contentDocument.open();
+ assert_array_equals(element.takeLog().types(), ['disconnected']);
+}, 'open on Document must enqueue disconnectedCallback when removing a custom element');
+
+test_with_window(function (contentWindow, contentDocument) {
+ const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+ contentDocument.body.innerHTML = '<custom-element></custom-element>';
+ assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+
+ contentDocument.write('');
+ assert_array_equals(element.takeLog().types(), ['disconnected']);
+}, 'write on Document must enqueue disconnectedCallback when removing a custom element');
+
+test_with_window(function (contentWindow, contentDocument) {
+ const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+ contentWindow.document.write('<custom-element></custom-element>');
+ assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+}, 'write on Document must enqueue connectedCallback after constructing a custom element');
+
+test_with_window(function (contentWindow, contentDocument) {
+ const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+ contentDocument.body.innerHTML = '<custom-element></custom-element>';
+ assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+
+ contentDocument.writeln('');
+ assert_array_equals(element.takeLog().types(), ['disconnected']);
+}, 'writeln on Document must enqueue disconnectedCallback when removing a custom element');
+
+test_with_window(function (contentWindow) {
+ const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+ contentWindow.document.writeln('<custom-element></custom-element>');
+ assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+}, 'writeln on Document must enqueue connectedCallback after constructing a custom element');
+
</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698