Index: Source/core/testing/DictionaryTest.h |
diff --git a/Source/core/testing/DictionaryTest.h b/Source/core/testing/DictionaryTest.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a55fc267256bd6f455316941d6006e15a7bb5184 |
--- /dev/null |
+++ b/Source/core/testing/DictionaryTest.h |
@@ -0,0 +1,49 @@ |
+// 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. |
+ |
+#ifndef DictionaryTest_h |
+#define DictionaryTest_h |
+ |
+#include "bindings/core/v8/Nullable.h" |
+#include "bindings/core/v8/ScriptWrappable.h" |
+#include "platform/heap/Handle.h" |
+#include "wtf/text/WTFString.h" |
+ |
+namespace blink { |
+ |
+class TestingDictionary; |
+ |
+class DictionaryTest : public GarbageCollectedFinalized<DictionaryTest>, public ScriptWrappable { |
+public: |
+ static DictionaryTest* create() |
+ { |
+ return new DictionaryTest(); |
+ } |
+ virtual ~DictionaryTest(); |
+ |
+ // Stores all members into corresponding fields |
+ void set(const TestingDictionary*); |
+ // Creates a TestDictionary instnace from fields and returns it |
+ TestingDictionary* get(); |
+ |
+ void trace(Visitor*); |
+ |
+private: |
+ DictionaryTest(); |
+ |
+ void reset(); |
+ |
+ // The reason to use Nullable<T> is convenience; we use Nullable<T> here to |
+ // record whether the member field is set or not. |stringMember| isn't |
+ // wrapped with Nullable because |stringMember| has a non-null default value |
+ Nullable<unsigned> m_longMember; |
+ String m_stringMember; |
+ Nullable<bool> m_booleanOrNullMember; |
+ Nullable<double> m_doubleOrNullMember; |
+ Nullable<Vector<String> > m_stringSequenceMember; |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // DictionaryTest_h |