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

Unified Diff: LayoutTests/fast/dom/idl-dictionary-unittest.html

Issue 1057453002: bindings: Throw TypeError when required dictionary member is undefined (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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 | LayoutTests/fast/dom/idl-dictionary-unittest-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/idl-dictionary-unittest.html
diff --git a/LayoutTests/fast/dom/idl-dictionary-unittest.html b/LayoutTests/fast/dom/idl-dictionary-unittest.html
index a31e4945b982104983ef129c81dbfc0322bd27b7..1a989429f67e867ea4a6e32cacb13c1759a6f178 100644
--- a/LayoutTests/fast/dom/idl-dictionary-unittest.html
+++ b/LayoutTests/fast/dom/idl-dictionary-unittest.html
@@ -243,7 +243,7 @@ if (window.internals && internals.dictionaryTest) {
debug('');
debug('Test for derived dictionary');
- dictionaryTest.setDerived({});
+ dictionaryTest.setDerived({ requiredBooleanMember: true });
derived = dictionaryTest.getDerived();
shouldBeUndefined('derived.longMember');
shouldBe('derived.longMemberWithDefault', '42');
@@ -264,6 +264,7 @@ if (window.internals && internals.dictionaryTest) {
shouldBeNull('derived.objectOrNullMemberWithDefault');
shouldBeUndefined('derived.derivedStringMember');
shouldBeEqualToString('derived.derivedStringMemberWithDefault', 'derivedDefaultStringValue');
+ shouldBeTrue('derived.requiredBooleanMember');
debug('');
dictionaryTest.setDerived({
@@ -272,6 +273,7 @@ if (window.internals && internals.dictionaryTest) {
derivedStringMember: 'modifiedString2',
derivedStringMemberWithDefault: 'modifiedString3',
invalidMember: 'shouldNotBeSet',
+ requiredBooleanMember: false,
});
derived = dictionaryTest.getDerived();
shouldBe('derived.longMember', '1');
@@ -279,8 +281,11 @@ if (window.internals && internals.dictionaryTest) {
shouldBeEqualToString('derived.derivedStringMember', 'modifiedString2');
shouldBeEqualToString('derived.derivedStringMemberWithDefault', 'modifiedString3');
shouldBeUndefined('derived.invalidMember');
-
+ shouldBeFalse('derived.requiredBooleanMember');
debug('');
- shouldThrow("dictionaryTest.setDerived({objectMember: 42})");
+
+ debug('Test for passing invalid values as derived dictionary');
+ shouldThrow("dictionaryTest.setDerived({objectMember: 42, requiredBooleanMember: false })");
+ shouldThrow("dictionaryTest.setDerived({})"); // Missing required member.
}
</script>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/idl-dictionary-unittest-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698