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

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

Issue 534133002: [WIP] bindings: Introduce PropertyBag (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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/InternalDictionary.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 43e7f6d98de109250288360d66796efd48c99043..2ee358c7324f9e2a64edab4860d870be41ab1611 100644
--- a/Source/core/testing/DictionaryTest.cpp
+++ b/Source/core/testing/DictionaryTest.cpp
@@ -22,13 +22,27 @@ void DictionaryTest::set(const InternalDictionary* testingDictionary)
reset();
if (testingDictionary->hasLongMember())
m_longMember = testingDictionary->longMember();
+ m_longMemberWithDefault = testingDictionary->longMemberWithDefault();
+ if (testingDictionary->hasLongOrNullMember())
+ m_longOrNullMember = testingDictionary->longOrNullMember();
+ // |longOrNullMemberWithDefault| has a default value but can be null, so
+ // we need to check availability.
+ if (testingDictionary->hasLongOrNullMemberWithDefault())
+ m_longOrNullMemberWithDefault = testingDictionary->longOrNullMemberWithDefault();
+ if (testingDictionary->hasBooleanMember())
+ m_booleanMember = testingDictionary->booleanMember();
+ if (testingDictionary->hasDoubleMember())
+ m_doubleMember = testingDictionary->doubleMember();
m_stringMember = testingDictionary->stringMember();
- if (testingDictionary->hasBooleanOrNullMember())
- m_booleanOrNullMember = testingDictionary->booleanOrNullMember();
- if (testingDictionary->hasDoubleOrNullMember())
- m_doubleOrNullMember = testingDictionary->doubleOrNullMember();
+ m_stringMemberWithDefault = testingDictionary->stringMemberWithDefault();
if (testingDictionary->hasStringSequenceMember())
m_stringSequenceMember = testingDictionary->stringSequenceMember();
+ if (testingDictionary->hasStringSequenceOrNullMember())
+ m_stringSequenceOrNullMember = testingDictionary->stringSequenceOrNullMember();
+ if (testingDictionary->hasElementMember())
+ m_elementMember = testingDictionary->elementMember();
+ if (testingDictionary->hasElementOrNullMember())
+ m_elementOrNullMember = testingDictionary->elementOrNullMember();
}
InternalDictionary* DictionaryTest::get()
@@ -36,23 +50,42 @@ InternalDictionary* DictionaryTest::get()
InternalDictionary* result = InternalDictionary::create();
if (m_longMember)
result->setLongMember(m_longMember.get());
+ result->setLongMemberWithDefault(m_longMemberWithDefault);
+ if (m_longOrNullMember)
+ result->setLongOrNullMember(m_longOrNullMember.get());
+ if (m_longOrNullMemberWithDefault)
+ result->setLongOrNullMemberWithDefault(m_longOrNullMemberWithDefault.get());
+ if (m_booleanMember)
+ result->setBooleanMember(m_booleanMember.get());
+ if (m_doubleMember)
+ result->setDoubleMember(m_doubleMember.get());
result->setStringMember(m_stringMember);
- if (m_booleanOrNullMember)
- result->setBooleanOrNullMember(m_booleanOrNullMember.get());
- if (m_doubleOrNullMember)
- result->setDoubleOrNullMember(m_doubleOrNullMember.get());
+ result->setStringMemberWithDefault(m_stringMemberWithDefault);
if (m_stringSequenceMember)
result->setStringSequenceMember(m_stringSequenceMember.get());
+ if (m_stringSequenceOrNullMember)
+ result->setStringSequenceOrNullMember(m_stringSequenceOrNullMember.get());
+ if (m_elementMember)
+ result->setElementMember(m_elementMember);
+ if (m_elementOrNullMember)
+ result->setElementOrNullMember(m_elementOrNullMember);
return result;
}
void DictionaryTest::reset()
{
- m_longMember = Nullable<unsigned>();
+ m_longMember = Nullable<int>();
+ m_longMemberWithDefault = -1; // This value should not be returned.
+ m_longOrNullMember = Nullable<int>();
+ m_longOrNullMemberWithDefault = Nullable<int>();
+ m_booleanMember = Nullable<bool>();
+ m_doubleMember = Nullable<double>();
m_stringMember = String();
- m_booleanOrNullMember = Nullable<bool>();
- m_doubleOrNullMember = Nullable<double>();
+ m_stringMemberWithDefault = String("Should not be returned");
m_stringSequenceMember = Nullable<Vector<String> >();
+ m_stringSequenceOrNullMember = Nullable<Vector<String> >();
+ m_elementMember = nullptr;
+ m_elementOrNullMember = nullptr;
}
void DictionaryTest::trace(Visitor*)
« no previous file with comments | « Source/core/testing/DictionaryTest.h ('k') | Source/core/testing/InternalDictionary.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698