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

Unified Diff: Source/core/testing/DictionaryTest.cpp

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 | « Source/core/testing/DictionaryTest.h ('k') | Source/core/testing/InternalDictionaryDerived.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/testing/DictionaryTest.cpp
diff --git a/Source/core/testing/DictionaryTest.cpp b/Source/core/testing/DictionaryTest.cpp
index 19dac4dcea9d88f94946f59f9a61fc6c2f97310d..206c57a759024a7d9f0321d77aa0ca0ae33eddad 100644
--- a/Source/core/testing/DictionaryTest.cpp
+++ b/Source/core/testing/DictionaryTest.cpp
@@ -11,6 +11,7 @@
namespace blink {
DictionaryTest::DictionaryTest()
+ : m_requiredBooleanMember(false)
{
}
@@ -105,10 +106,12 @@ void DictionaryTest::get(InternalDictionary& result)
void DictionaryTest::setDerived(const InternalDictionaryDerived& derived)
{
+ ASSERT(derived.hasRequiredBooleanMember());
set(derived);
if (derived.hasDerivedStringMember())
m_derivedStringMember = derived.derivedStringMember();
m_derivedStringMemberWithDefault = derived.derivedStringMemberWithDefault();
+ m_requiredBooleanMember = derived.requiredBooleanMember();
}
void DictionaryTest::getDerived(InternalDictionaryDerived& result)
@@ -116,6 +119,7 @@ void DictionaryTest::getDerived(InternalDictionaryDerived& result)
get(result);
result.setDerivedStringMember(m_derivedStringMember);
result.setDerivedStringMemberWithDefault(m_derivedStringMemberWithDefault);
+ result.setRequiredBooleanMember(m_requiredBooleanMember);
}
void DictionaryTest::reset()
@@ -144,6 +148,7 @@ void DictionaryTest::reset()
m_eventTargetOrNullMember = nullptr;
m_derivedStringMember = String();
m_derivedStringMemberWithDefault = String();
+ m_requiredBooleanMember = false;
}
DEFINE_TRACE(DictionaryTest)
« no previous file with comments | « Source/core/testing/DictionaryTest.h ('k') | Source/core/testing/InternalDictionaryDerived.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698