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

Unified Diff: third_party/WebKit/LayoutTests/shadow-dom/v1-attachShadow-safelist.html

Issue 2053503003: Clean up layout tests in LayoutTests/shadow-dom/ (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/shadow-dom/v1-attachShadow-safelist.html
diff --git a/third_party/WebKit/LayoutTests/shadow-dom/v1-attachShadow-safelist.html b/third_party/WebKit/LayoutTests/shadow-dom/v1-attachShadow-safelist.html
deleted file mode 100644
index 3f2a9fc35b5259c032f03705364c0435f4241a1f..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/shadow-dom/v1-attachShadow-safelist.html
+++ /dev/null
@@ -1,44 +0,0 @@
-<!DOCTYPE html>
-<script src='../resources/testharness.js'></script>
-<script src='../resources/testharnessreport.js'></script>
-<script>
-'use strict';
-
-const safelist = ['custom-element',
- 'article', 'aside', 'blockquote', 'body', 'div', 'footer',
- 'h1', 'h2', 'h3', 'h4', 'h5', 'h6',
- 'header', 'nav', 'p', 'section', 'span'];
-
-test(() => {
- safelist.forEach((tag) => {
- ['open', 'closed'].forEach((mode) => {
- const sr = document.createElement(tag).attachShadow({mode: mode});
- assert_true(sr instanceof ShadowRoot, "attachShadow is supported for " + tag);
- });
- });
-}, 'attachShadow should not fail for an element in the safelist');
-
-test(() => {
- // Retrieve possible tag names from window object's own property names
- Object.getOwnPropertyNames(window).forEach((p) => {
- const res = /^HTML(.*)Element$/.exec(p);
- if (!res)
- return;
- const maybeTagName = res[1].toLowerCase();
- if (safelist.includes(maybeTagName) || maybeTagName.indexOf('-') != -1)
- return;
- var element;
- try {
- element = document.createElement(maybeTagName);
- } catch (e) {
- // Okay to ignore when document.createElement fails
- return;
- }
- ['open', 'closed'].forEach((mode) => {
- assert_throws({name: 'NotSupportedError'}, () => {
- element.attachShadow({mode: mode});
- }), 'attachShadow should throw NotSupportdeError for ' + maybeTagName;
- });
- });
-}, 'attachShadow should throw an exception for an element which is not in the safelist');
-</script>

Powered by Google App Engine
This is Rietveld 408576698