OLD | NEW |
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 #include "DictionaryTest.h" | 5 #include "DictionaryTest.h" |
6 | 6 |
7 #include "bindings/core/v8/V8ObjectBuilder.h" | 7 #include "bindings/core/v8/V8ObjectBuilder.h" |
8 #include "core/testing/InternalDictionary.h" | 8 #include "core/testing/InternalDictionary.h" |
9 #include "core/testing/InternalDictionaryDerived.h" | 9 #include "core/testing/InternalDictionaryDerived.h" |
| 10 #include "core/testing/InternalDictionaryDerivedDerived.h" |
10 | 11 |
11 namespace blink { | 12 namespace blink { |
12 | 13 |
13 DictionaryTest::DictionaryTest() | 14 DictionaryTest::DictionaryTest() |
14 : m_requiredBooleanMember(false) | 15 : m_requiredBooleanMember(false) |
15 { | 16 { |
16 } | 17 } |
17 | 18 |
18 DictionaryTest::~DictionaryTest() | 19 DictionaryTest::~DictionaryTest() |
19 { | 20 { |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 } | 142 } |
142 | 143 |
143 void DictionaryTest::getDerived(InternalDictionaryDerived& result) | 144 void DictionaryTest::getDerived(InternalDictionaryDerived& result) |
144 { | 145 { |
145 get(result); | 146 get(result); |
146 result.setDerivedStringMember(m_derivedStringMember); | 147 result.setDerivedStringMember(m_derivedStringMember); |
147 result.setDerivedStringMemberWithDefault(m_derivedStringMemberWithDefault); | 148 result.setDerivedStringMemberWithDefault(m_derivedStringMemberWithDefault); |
148 result.setRequiredBooleanMember(m_requiredBooleanMember); | 149 result.setRequiredBooleanMember(m_requiredBooleanMember); |
149 } | 150 } |
150 | 151 |
| 152 void DictionaryTest::setDerivedDerived(const InternalDictionaryDerivedDerived& d
erived) |
| 153 { |
| 154 setDerived(derived); |
| 155 if (derived.hasDerivedDerivedStringMember()) |
| 156 m_derivedDerivedStringMember = derived.derivedDerivedStringMember(); |
| 157 } |
| 158 |
| 159 void DictionaryTest::getDerivedDerived(InternalDictionaryDerivedDerived& result) |
| 160 { |
| 161 getDerived(result); |
| 162 result.setDerivedDerivedStringMember(m_derivedDerivedStringMember); |
| 163 } |
| 164 |
151 String DictionaryTest::stringFromIterable(ExecutionContext* executionContext, Di
ctionary iterable, ExceptionState& exceptionState) const | 165 String DictionaryTest::stringFromIterable(ExecutionContext* executionContext, Di
ctionary iterable, ExceptionState& exceptionState) const |
152 { | 166 { |
153 StringBuilder result; | 167 StringBuilder result; |
154 DictionaryIterator iterator = iterable.getIterator(executionContext); | 168 DictionaryIterator iterator = iterable.getIterator(executionContext); |
155 if (iterator.isNull()) | 169 if (iterator.isNull()) |
156 return emptyString(); | 170 return emptyString(); |
157 | 171 |
158 bool firstLoop = true; | 172 bool firstLoop = true; |
159 while (iterator.next(executionContext, exceptionState)) { | 173 while (iterator.next(executionContext, exceptionState)) { |
160 if (exceptionState.hadException()) | 174 if (exceptionState.hadException()) |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 | 221 |
208 DEFINE_TRACE(DictionaryTest) | 222 DEFINE_TRACE(DictionaryTest) |
209 { | 223 { |
210 visitor->trace(m_elementMember); | 224 visitor->trace(m_elementMember); |
211 visitor->trace(m_elementOrNullMember); | 225 visitor->trace(m_elementOrNullMember); |
212 visitor->trace(m_doubleOrStringSequenceMember); | 226 visitor->trace(m_doubleOrStringSequenceMember); |
213 visitor->trace(m_eventTargetOrNullMember); | 227 visitor->trace(m_eventTargetOrNullMember); |
214 } | 228 } |
215 | 229 |
216 } // namespace blink | 230 } // namespace blink |
OLD | NEW |