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

Unified Diff: third_party/WebKit/LayoutTests/shadow-dom/slotchange-event.html

Issue 2071133004: Remove old tests for slotchange events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@slotchange
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/shadow-dom/slotchange-event.html
diff --git a/third_party/WebKit/LayoutTests/shadow-dom/slotchange-event.html b/third_party/WebKit/LayoutTests/shadow-dom/slotchange-event.html
deleted file mode 100644
index ec272dcecdc9722fd56388c333384de272fc1aa0..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/shadow-dom/slotchange-event.html
+++ /dev/null
@@ -1,76 +0,0 @@
-<!DOCTYPE html>
-<script src='../resources/testharness.js'></script>
-<script src='../resources/testharnessreport.js'></script>
-<script src='resources/shadow-dom.js'></script>
-<div id='d1'>
- <template data-mode='open' data-expose-as='d1_shadow'>
- <div id='d1-d1'>
- <template data-mode='open' data-expose-as='d1_d1_shadow'>
- <slot name='d1-d1-s1'></slot>
- </template>
- <slot name='d1-s1' slot='d1-d1-s1'></slot>
- </div>
- </template>
- <div id='d2' slot='d1-s1'></div>
-</div>
-<script>
-'use strict';
-convertTemplatesToShadowRootsWithin(d1);
-removeWhiteSpaceOnlyTextNodes(d1);
-
-async_test((test) => {
- var count_for_d1_s1 = 0;
- var count_for_d1_d1_s1 = 0;
-
- const d1_s1 = d1_shadow.querySelector('slot');
- const d1_d1_s1 = d1_d1_shadow.querySelector('slot');
-
- assert_array_equals(d1_s1.assignedNodes(), [d2]);
- assert_array_equals(d1_s1.assignedNodes({'flatten': true}), [d2]);
-
- assert_array_equals(d1_d1_s1.assignedNodes(), [d1_s1]);
- assert_array_equals(d1_d1_s1.assignedNodes({'flatten': true}), [d2]);
-
- d1_s1.addEventListener('slotchange', (e) => {
- test.step(() => {
- count_for_d1_s1++;
- if (count_for_d1_s1 == 1) {
- assert_equals(e.target, d1_s1);
- assert_array_equals(d1_s1.assignedNodes(), [d2, d3]);
- assert_array_equals(d1_s1.assignedNodes({'flatten': true}), [d2, d3]);
- } else if (count_for_d1_s1 == 2) {
- assert_equals(e.target, d1_s1);
- assert_array_equals(d1_s1.assignedNodes(), [d2]);
- assert_array_equals(d1_s1.assignedNodes({'flatten': true}), [d2]);
- test.done();
- }
- });
- });
-
- d1_d1_s1.addEventListener('slotchange', (e) => {
- test.step(() => {
- count_for_d1_d1_s1++;
- if (count_for_d1_d1_s1 == 1) {
- assert_equals(e.target, d1_d1_s1);
- assert_array_equals(d1_d1_s1.assignedNodes(), [d1_s1]);
- assert_array_equals(d1_d1_s1.assignedNodes({'flatten': true}), [d2, d3]);
- } else if (count_for_d1_d1_s1 == 2){
- assert_equals(e.target, d1_d1_s1);
- assert_array_equals(d1_d1_s1.assignedNodes(), [d1_s1]);
- assert_array_equals(d1_d1_s1.assignedNodes({'flatten': true}), [d2]);
- test.done();
- }
- });
- });
-
- const d3 = document.createElement('div');
- d3.setAttribute('id', 'd3');
- d3.setAttribute('slot', 'd1-s1');
- d1.appendChild(d3);
- // Different microtask.
- setTimeout(function(){
- d3.remove();
- }, 0);
-
-}, "slotchange event should be dispatched for a slot at most once per microtask.");
-</script>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698