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

Side by Side Diff: third_party/WebKit/Source/core/testing/DictionaryTest.h

Issue 2183623004: Add IDLDictionaryBase (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix multi-level inheritance bug Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef DictionaryTest_h 5 #ifndef DictionaryTest_h
6 #define DictionaryTest_h 6 #define DictionaryTest_h
7 7
8 #include "bindings/core/v8/DoubleOrString.h" 8 #include "bindings/core/v8/DoubleOrString.h"
9 #include "bindings/core/v8/Nullable.h" 9 #include "bindings/core/v8/Nullable.h"
10 #include "bindings/core/v8/ScriptState.h" 10 #include "bindings/core/v8/ScriptState.h"
11 #include "bindings/core/v8/ScriptValue.h" 11 #include "bindings/core/v8/ScriptValue.h"
12 #include "bindings/core/v8/ScriptWrappable.h" 12 #include "bindings/core/v8/ScriptWrappable.h"
13 #include "core/dom/Element.h" 13 #include "core/dom/Element.h"
14 #include "platform/heap/Handle.h" 14 #include "platform/heap/Handle.h"
15 #include "wtf/HashMap.h" 15 #include "wtf/HashMap.h"
16 #include "wtf/text/WTFString.h" 16 #include "wtf/text/WTFString.h"
17 17
18 namespace blink { 18 namespace blink {
19 19
20 class InternalDictionary; 20 class InternalDictionary;
21 class InternalDictionaryDerived; 21 class InternalDictionaryDerived;
22 class InternalDictionaryDerivedDerived;
22 23
23 class DictionaryTest : public GarbageCollectedFinalized<DictionaryTest>, public ScriptWrappable { 24 class DictionaryTest : public GarbageCollectedFinalized<DictionaryTest>, public ScriptWrappable {
24 DEFINE_WRAPPERTYPEINFO(); 25 DEFINE_WRAPPERTYPEINFO();
25 public: 26 public:
26 static DictionaryTest* create() 27 static DictionaryTest* create()
27 { 28 {
28 return new DictionaryTest(); 29 return new DictionaryTest();
29 } 30 }
30 virtual ~DictionaryTest(); 31 virtual ~DictionaryTest();
31 32
32 // Stores all members into corresponding fields 33 // Stores all members into corresponding fields
33 void set(const InternalDictionary&); 34 void set(const InternalDictionary&);
34 // Sets each member of the given TestDictionary from fields 35 // Sets each member of the given TestDictionary from fields
35 void get(InternalDictionary&); 36 void get(InternalDictionary&);
36 // Returns properties of the latest |dictionaryMember| which was set via 37 // Returns properties of the latest |dictionaryMember| which was set via
37 // set(). 38 // set().
38 ScriptValue getDictionaryMemberProperties(ScriptState*); 39 ScriptValue getDictionaryMemberProperties(ScriptState*);
39 40
40 void setDerived(const InternalDictionaryDerived&); 41 void setDerived(const InternalDictionaryDerived&);
41 void getDerived(InternalDictionaryDerived&); 42 void getDerived(InternalDictionaryDerived&);
42 43
44 void setDerivedDerived(const InternalDictionaryDerivedDerived&);
45 void getDerivedDerived(InternalDictionaryDerivedDerived&);
46
43 String stringFromIterable(ExecutionContext*, Dictionary iterable, ExceptionS tate&) const; 47 String stringFromIterable(ExecutionContext*, Dictionary iterable, ExceptionS tate&) const;
44 48
45 DECLARE_TRACE(); 49 DECLARE_TRACE();
46 50
47 private: 51 private:
48 DictionaryTest(); 52 DictionaryTest();
49 53
50 void reset(); 54 void reset();
51 55
52 // The reason to use Nullable<T> is convenience; we use Nullable<T> here to 56 // The reason to use Nullable<T> is convenience; we use Nullable<T> here to
(...skipping 23 matching lines...) Expand all
76 Nullable<Vector<String>> m_enumArrayMember; 80 Nullable<Vector<String>> m_enumArrayMember;
77 Member<Element> m_elementMember; 81 Member<Element> m_elementMember;
78 Member<Element> m_elementOrNullMember; 82 Member<Element> m_elementOrNullMember;
79 ScriptValue m_objectMember; 83 ScriptValue m_objectMember;
80 ScriptValue m_objectOrNullMemberWithDefault; 84 ScriptValue m_objectOrNullMemberWithDefault;
81 DoubleOrString m_doubleOrStringMember; 85 DoubleOrString m_doubleOrStringMember;
82 Nullable<HeapVector<DoubleOrString>> m_doubleOrStringSequenceMember; 86 Nullable<HeapVector<DoubleOrString>> m_doubleOrStringSequenceMember;
83 Member<EventTarget> m_eventTargetOrNullMember; 87 Member<EventTarget> m_eventTargetOrNullMember;
84 String m_derivedStringMember; 88 String m_derivedStringMember;
85 String m_derivedStringMemberWithDefault; 89 String m_derivedStringMemberWithDefault;
90 String m_derivedDerivedStringMember;
86 bool m_requiredBooleanMember; 91 bool m_requiredBooleanMember;
87 Nullable<HashMap<String, String>> m_dictionaryMemberProperties; 92 Nullable<HashMap<String, String>> m_dictionaryMemberProperties;
88 }; 93 };
89 94
90 } // namespace blink 95 } // namespace blink
91 96
92 #endif // DictionaryTest_h 97 #endif // DictionaryTest_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698