Index: Source/core/testing/UnionTypesTest.cpp |
diff --git a/Source/core/testing/UnionTypesTest.cpp b/Source/core/testing/UnionTypesTest.cpp |
index bcf5519d1fe9258b7bb82c3ec126fece668ff3f9..e5af4a1df571cf9391d231acf702e5d1e60ec809 100644 |
--- a/Source/core/testing/UnionTypesTest.cpp |
+++ b/Source/core/testing/UnionTypesTest.cpp |
@@ -7,6 +7,35 @@ |
namespace blink { |
+void UnionTypesTest::doubleOrStringAttribute(DoubleOrString& doubleOrString) |
+{ |
+ switch (m_attributeType) { |
+ case SpecificTypeNone: |
+ break; |
+ case SpecificTypeDouble: |
+ doubleOrString.setDouble(m_attributeDouble); |
+ break; |
+ case SpecificTypeString: |
+ doubleOrString.setString(m_attributeString); |
+ break; |
+ default: |
+ ASSERT_NOT_REACHED(); |
+ } |
+} |
+ |
+void UnionTypesTest::setDoubleOrStringAttribute(const DoubleOrString& doubleOrString) |
+{ |
+ if (doubleOrString.isDouble()) { |
+ m_attributeDouble = doubleOrString.getAsDouble(); |
+ m_attributeType = SpecificTypeDouble; |
+ } else if (doubleOrString.isString()) { |
+ m_attributeString = doubleOrString.getAsString(); |
+ m_attributeType = SpecificTypeString; |
+ } else { |
+ ASSERT_NOT_REACHED(); |
+ } |
+} |
+ |
String UnionTypesTest::doubleOrStringArg(DoubleOrString& doubleOrString) |
{ |
ASSERT(!doubleOrString.isNull()); |