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

Side by Side 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, 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 unified diff | Download patch
« no previous file with comments | « Source/core/testing/DictionaryTest.h ('k') | Source/core/testing/DictionaryTest.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "DictionaryTest.h"
7
8 #include "core/testing/InternalDictionary.h"
9
10 namespace blink {
11
12 DictionaryTest::DictionaryTest()
13 {
14 ScriptWrappable::init(this);
15 }
16
17 DictionaryTest::~DictionaryTest()
18 {
19 }
20
21 void DictionaryTest::set(const InternalDictionary* testingDictionary)
22 {
23 reset();
24 if (testingDictionary->hasLongMember())
25 m_longMember = testingDictionary->longMember();
26 m_stringMember = testingDictionary->stringMember();
27 if (testingDictionary->hasBooleanOrNullMember())
28 m_booleanOrNullMember = testingDictionary->booleanOrNullMember();
29 if (testingDictionary->hasDoubleOrNullMember())
30 m_doubleOrNullMember = testingDictionary->doubleOrNullMember();
31 if (testingDictionary->hasStringSequenceMember())
32 m_stringSequenceMember = testingDictionary->stringSequenceMember();
33 }
34
35 InternalDictionary* DictionaryTest::get()
36 {
37 InternalDictionary* result = InternalDictionary::create();
38 if (m_longMember)
39 result->setLongMember(m_longMember.get());
40 result->setStringMember(m_stringMember);
41 if (m_booleanOrNullMember)
42 result->setBooleanOrNullMember(m_booleanOrNullMember.get());
43 if (m_doubleOrNullMember)
44 result->setDoubleOrNullMember(m_doubleOrNullMember.get());
45 if (m_stringSequenceMember)
46 result->setStringSequenceMember(m_stringSequenceMember.get());
47 return result;
48 }
49
50 void DictionaryTest::reset()
51 {
52 m_longMember = Nullable<unsigned>();
53 m_stringMember = String();
54 m_booleanOrNullMember = Nullable<bool>();
55 m_doubleOrNullMember = Nullable<double>();
56 m_stringSequenceMember = Nullable<Vector<String> >();
57 }
58
59 void DictionaryTest::trace(Visitor*)
60 {
61 }
62
63 }
OLDNEW
« 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