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

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

Issue 429853002: IDL: Add build target for IDL dictionary impl generation in core (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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/DictionaryTest.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
new file mode 100644
index 0000000000000000000000000000000000000000..462860d19a07c008055a4c3708be4908beb69b45
--- /dev/null
+++ b/Source/core/testing/DictionaryTest.cpp
@@ -0,0 +1,63 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "DictionaryTest.h"
+
+#include "core/testing/InternalDictionary.h"
+
+namespace blink {
+
+DictionaryTest::DictionaryTest()
+{
+ ScriptWrappable::init(this);
+}
+
+DictionaryTest::~DictionaryTest()
+{
+}
+
+void DictionaryTest::set(const InternalDictionary* testingDictionary)
+{
+ reset();
+ if (testingDictionary->hasLongMember())
+ m_longMember = testingDictionary->longMember();
+ m_stringMember = testingDictionary->stringMember();
+ if (testingDictionary->hasBooleanOrNullMember())
+ m_booleanOrNullMember = testingDictionary->booleanOrNullMember();
+ if (testingDictionary->hasDoubleOrNullMember())
+ m_doubleOrNullMember = testingDictionary->doubleOrNullMember();
+ if (testingDictionary->hasStringSequenceMember())
+ m_stringSequenceMember = testingDictionary->stringSequenceMember();
+}
+
+InternalDictionary* DictionaryTest::get()
+{
+ InternalDictionary* result = InternalDictionary::create();
+ if (m_longMember)
+ result->setLongMember(m_longMember.get());
+ result->setStringMember(m_stringMember);
+ if (m_booleanOrNullMember)
+ result->setBooleanOrNullMember(m_booleanOrNullMember.get());
+ if (m_doubleOrNullMember)
+ result->setDoubleOrNullMember(m_doubleOrNullMember.get());
+ if (m_stringSequenceMember)
+ result->setStringSequenceMember(m_stringSequenceMember.get());
+ return result;
+}
+
+void DictionaryTest::reset()
+{
+ m_longMember = Nullable<unsigned>();
+ m_stringMember = String();
+ m_booleanOrNullMember = Nullable<bool>();
+ m_doubleOrNullMember = Nullable<double>();
+ m_stringSequenceMember = Nullable<Vector<String> >();
+}
+
+void DictionaryTest::trace(Visitor*)
+{
+}
+
+}
« no previous file with comments | « Source/core/testing/DictionaryTest.h ('k') | Source/core/testing/DictionaryTest.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698