Upstream version 11.40.271.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / testing / UnionTypesTest.h
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 #ifndef UnionTypesTest_h
6 #define UnionTypesTest_h
7
8 #include "bindings/core/v8/UnionTypesCore.h"
9 #include "wtf/text/WTFString.h"
10
11 namespace blink {
12
13 class UnionTypesTest final : public GarbageCollectedFinalized<UnionTypesTest>, public ScriptWrappable {
14     DEFINE_WRAPPERTYPEINFO();
15 public:
16     static UnionTypesTest* create()
17     {
18         return new UnionTypesTest();
19     }
20     virtual ~UnionTypesTest() { }
21
22     void doubleOrStringAttribute(DoubleOrString&);
23     void setDoubleOrStringAttribute(const DoubleOrString&);
24
25     String doubleOrStringArg(DoubleOrString&);
26
27     void trace(Visitor*) { }
28
29 private:
30     UnionTypesTest()
31         : m_attributeType(SpecificTypeNone)
32     {
33     }
34
35     enum AttributeSpecificType {
36         SpecificTypeNone,
37         SpecificTypeDouble,
38         SpecificTypeString,
39     };
40     AttributeSpecificType m_attributeType;
41     double m_attributeDouble;
42     String m_attributeString;
43 };
44
45 } // namespace blink
46
47 #endif // UnionTypesTest_h