Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CEReactions tests #14711

Merged
merged 2 commits into from Jan 30, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions custom-elements/reactions/HTMLCanvasElement.html
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<title>Custom Elements: CEReactions on HTMLCanvasElement interface</title>
<link rel="author" title="Intel" href="http://www.intel.com">
<meta name="assert" content="width, height of HTMLCanvasElement interface must have CEReactions">
<meta name="help" content="https://html.spec.whatwg.org/#the-canvas-element">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/custom-elements-helpers.js"></script>
<script src="./resources/reactions.js"></script>

<script>

testReflectAttribute('width', 'width', '15', '20', 'width on HTMLCanvasElement', 'canvas', HTMLCanvasElement);
testReflectAttribute('height', 'height', '23', '45', 'height on HTMLCanvasElement', 'canvas', HTMLCanvasElement);

</script>
15 changes: 15 additions & 0 deletions custom-elements/reactions/HTMLDataElement.html
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<title>Custom Elements: CEReactions on HTMLDataElement interface</title>
<link rel="author" title="Intel" href="http://www.intel.com">
<meta name="assert" content="value of HTMLDataElement interface must have CEReactions">
<meta name="help" content="https://html.spec.whatwg.org/#the-data-element">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/custom-elements-helpers.js"></script>
<script src="./resources/reactions.js"></script>

<script>

testReflectAttribute('value', 'value', '1234', '2345', 'name on HTMLDataElement', 'data', HTMLDataElement);

</script>
15 changes: 15 additions & 0 deletions custom-elements/reactions/HTMLDetailsElement.html
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<title>Custom Elements: CEReactions on HTMLDetailsElement interface</title>
<link rel="author" title="Intel" href="http://www.intel.com">
<meta name="assert" content="open of HTMLDetailsElement interface must have CEReactions">
<meta name="help" content="https://html.spec.whatwg.org/#the-details-element">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/custom-elements-helpers.js"></script>
<script src="./resources/reactions.js"></script>

<script>

testReflectAttribute('open', 'open', 'true', 'false', 'open on HTMLDetailsElement', 'details', HTMLDetailsElement);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boolean attributes don't get reflected by the strings "true" and "false". They get reflected by the removal or addition of the attribute.


</script>
17 changes: 17 additions & 0 deletions custom-elements/reactions/HTMLMapElement.html
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<title>Custom Elements: CEReactions on HTMLMapElement interface</title>
<link rel="author" title="Intel" href="http://www.intel.com">
<meta name="assert" content="name of HTMLMapElement interface must have CEReactions">
<meta name="help" content="https://html.spec.whatwg.org/#the-map-element">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/custom-elements-helpers.js"></script>
<script src="./resources/reactions.js"></script>

<img usemap="#yellow" src="/images/yellow.png" alt="yellow pic">
<img usemap="#green" src="/images/green.png" alt="green pic">
<script>

testReflectAttribute('name', 'name', 'yellow', 'green', 'name on HTMLMapElement', 'map', HTMLMapElement);

</script>
18 changes: 18 additions & 0 deletions custom-elements/reactions/HTMLModElement.html
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<title>Custom Elements: CEReactions on HTMLModElement interface</title>
<link rel="author" title="Intel" href="http://www.intel.com">
<meta name="assert" content="cite, dateTime of HTMLModElement interface must have CEReactions">
<meta name="help" content="https://html.spec.whatwg.org/#attributes-common-to-ins-and-del-elements">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/custom-elements-helpers.js"></script>
<script src="./resources/reactions.js"></script>

<script>

testReflectAttribute('cite', 'cite', '../resources/custom-elements-helpers.js', './resources/reactions.js', 'cite on ins use HTMLModElement', 'ins', HTMLModElement);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test fails on Chrome. I believe it is because the attribute name is datetime, not dateTime.

testReflectAttribute('dateTime', 'dateTime', '2018-12-19 00:00Z', '2018-12-20 00:00Z', 'dateTime on ins use HTMLModElement', 'ins', HTMLModElement);
testReflectAttribute('cite', 'cite', '../resources/custom-elements-helpers.js', './resources/reactions.js', 'cite on del use HTMLModElement', 'del', HTMLModElement);
testReflectAttribute('dateTime', 'dateTime', '2018-10-11T01:25-07:00', '2018-10-12T01:25-07:00', 'dateTime on del use HTMLModElement', 'del', HTMLModElement);

</script>
17 changes: 17 additions & 0 deletions custom-elements/reactions/HTMLOListElement.html
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<title>Custom Elements: CEReactions on HTMLOListElement interface</title>
<link rel="author" title="Intel" href="http://www.intel.com">
<meta name="assert" content="reversed, start, type of HTMLOListElement interface must have CEReactions">
<meta name="help" content="https://html.spec.whatwg.org/#the-ol-element">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/custom-elements-helpers.js"></script>
<script src="./resources/reactions.js"></script>

<script>

testReflectAttribute('reversed', 'reversed', 'true', 'false', 'reversed on HTMLOListElement', 'ol', HTMLOListElement);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boolean attributes problem again

testReflectAttribute('start', 'start', '2', '5', 'start on HTMLOListElement', 'ol', HTMLOListElement);
testReflectAttribute('type', 'type', '1', 'a', 'type on HTMLOListElement', 'ol', HTMLOListElement);

</script>
16 changes: 16 additions & 0 deletions custom-elements/reactions/HTMLQuoteElement.html
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<title>Custom Elements: CEReactions on HTMLQuoteElement interface</title>
<link rel="author" title="Intel" href="http://www.intel.com">
<meta name="assert" content="cite of HTMLQuoteElement interface must have CEReactions">
<meta name="help" content="https://html.spec.whatwg.org/#the-blockquote-element">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/custom-elements-helpers.js"></script>
<script src="./resources/reactions.js"></script>

<script>

testReflectAttribute('cite', 'cite', '../resources/custom-elements-helpers.js', './resources/reactions.js', 'cite on blockquote use HTMLQuoteElement', 'blockquote', HTMLQuoteElement);
testReflectAttribute('cite', 'cite', '../resources/custom-elements-helpers.js', './resources/reactions.js', 'cite on q use HTMLQuoteElement', 'q', HTMLQuoteElement);

</script>
15 changes: 15 additions & 0 deletions custom-elements/reactions/HTMLSlotElement.html
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<title>Custom Elements: CEReactions on HTMLSlotElement interface</title>
<link rel="author" title="Intel" href="http://www.intel.com">
<meta name="assert" content="name of HTMLSlotElement interface must have CEReactions">
<meta name="help" content="https://html.spec.whatwg.org/#the-slot-element">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/custom-elements-helpers.js"></script>
<script src="./resources/reactions.js"></script>

<script>

testReflectAttribute('name', 'name', 'slot1', 'slot2', 'name on HTMLSlotElement', 'slot', HTMLSlotElement);

</script>
15 changes: 15 additions & 0 deletions custom-elements/reactions/HTMLTimeElement.html
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<title>Custom Elements: CEReactions on HTMLTimeElement interface</title>
<link rel="author" title="Intel" href="http://www.intel.com">
<meta name="assert" content="name of HTMLTimeElement interface must have CEReactions">
<meta name="help" content="https://html.spec.whatwg.org/#the-time-element">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/custom-elements-helpers.js"></script>
<script src="./resources/reactions.js"></script>

<script>

testReflectAttribute('dateTime', 'dateTime', '2018-12-10', '2018-12-12', 'dateTime on HTMLTimeElement', 'time', HTMLTimeElement);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also fails on Chrome, also I guess for the same reason.


</script>