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

Side by Side Diff: Source/bindings/tests/results/V8TestObject.cpp

Issue 105543004: Add bindings tests coverage for reflected attributes with a SVG animated type (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Group new attribute with other reflected attributes Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « Source/bindings/tests/idls/TestObject.idl ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 21 matching lines...) Expand all
32 32
33 #include "config.h" 33 #include "config.h"
34 #include "V8TestObject.h" 34 #include "V8TestObject.h"
35 35
36 #include "HTMLNames.h" 36 #include "HTMLNames.h"
37 #include "RuntimeEnabledFeatures.h" 37 #include "RuntimeEnabledFeatures.h"
38 #include "V8DOMStringList.h" 38 #include "V8DOMStringList.h"
39 #include "V8Document.h" 39 #include "V8Document.h"
40 #include "V8MessagePort.h" 40 #include "V8MessagePort.h"
41 #include "V8Node.h" 41 #include "V8Node.h"
42 #include "V8SVGAnimatedString.h"
42 #include "V8SVGDocument.h" 43 #include "V8SVGDocument.h"
43 #include "V8SVGPoint.h" 44 #include "V8SVGPoint.h"
44 #include "V8TestCallbackInterface.h" 45 #include "V8TestCallbackInterface.h"
45 #include "V8TestInterface.h" 46 #include "V8TestInterface.h"
46 #include "V8TestNode.h" 47 #include "V8TestNode.h"
47 #include "V8TestObjectectA.h" 48 #include "V8TestObjectectA.h"
48 #include "V8TestObjectectB.h" 49 #include "V8TestObjectectB.h"
49 #include "V8TestObjectectC.h" 50 #include "V8TestObjectectC.h"
50 #include "V8TestSubObj.h" 51 #include "V8TestSubObj.h"
51 #include "bindings/v8/BindingSecurity.h" 52 #include "bindings/v8/BindingSecurity.h"
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 } 837 }
837 838
838 static void reflectedCustomURLAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 839 static void reflectedCustomURLAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
839 { 840 {
840 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 841 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
841 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 842 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
842 TestObjV8Internal::reflectedCustomURLAttrAttributeSetter(jsValue, info); 843 TestObjV8Internal::reflectedCustomURLAttrAttributeSetter(jsValue, info);
843 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 844 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
844 } 845 }
845 846
847 static void animatedReflectedAttributeAttributeGetter(const v8::PropertyCallback Info<v8::Value>& info)
848 {
849 TestObj* imp = V8TestObject::toNative(info.Holder());
850 v8SetReturnValueFast(info, imp->getAttribute(HTMLNames::animatedreflectedatt ributeAttr), imp);
851 }
852
853 static void animatedReflectedAttributeAttributeGetterCallback(v8::Local<v8::Stri ng>, const v8::PropertyCallbackInfo<v8::Value>& info)
854 {
855 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
856 TestObjV8Internal::animatedReflectedAttributeAttributeGetter(info);
857 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
858 }
859
860 static void animatedReflectedAttributeAttributeSetter(v8::Local<v8::Value> jsVal ue, const v8::PropertyCallbackInfo<void>& info)
861 {
862 TestObj* imp = V8TestObject::toNative(info.Holder());
863 V8TRYCATCH_VOID(SVGAnimatedString*, cppValue, V8SVGAnimatedString::hasInstan ce(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGAnimatedStri ng::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
864 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
865 imp->setAttribute(HTMLNames::animatedreflectedattributeAttr, WTF::getPtr(cpp Value));
866 }
867
868 static void animatedReflectedAttributeAttributeSetterCallback(v8::Local<v8::Stri ng>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
869 {
870 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
871 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
872 TestObjV8Internal::animatedReflectedAttributeAttributeSetter(jsValue, info);
873 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
874 }
875
846 static void typedArrayAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Val ue>& info) 876 static void typedArrayAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Val ue>& info)
847 { 877 {
848 TestObj* imp = V8TestObject::toNative(info.Holder()); 878 TestObj* imp = V8TestObject::toNative(info.Holder());
849 v8SetReturnValueFast(info, imp->typedArrayAttr(), imp); 879 v8SetReturnValueFast(info, imp->typedArrayAttr(), imp);
850 } 880 }
851 881
852 static void typedArrayAttrAttributeGetterCallback(v8::Local<v8::String>, const v 8::PropertyCallbackInfo<v8::Value>& info) 882 static void typedArrayAttrAttributeGetterCallback(v8::Local<v8::String>, const v 8::PropertyCallbackInfo<v8::Value>& info)
853 { 883 {
854 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 884 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
855 TestObjV8Internal::typedArrayAttrAttributeGetter(info); 885 TestObjV8Internal::typedArrayAttrAttributeGetter(info);
(...skipping 4241 matching lines...) Expand 10 before | Expand all | Expand 10 after
5097 {"create", TestObjV8Internal::createAttributeGetterCallback, TestObjV8Intern al::createAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::D EFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 5127 {"create", TestObjV8Internal::createAttributeGetterCallback, TestObjV8Intern al::createAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::D EFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5098 {"reflectedStringAttr", TestObjV8Internal::reflectedStringAttrAttributeGette rCallback, TestObjV8Internal::reflectedStringAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribut e>(v8::None), 0 /* on instance */}, 5128 {"reflectedStringAttr", TestObjV8Internal::reflectedStringAttrAttributeGette rCallback, TestObjV8Internal::reflectedStringAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribut e>(v8::None), 0 /* on instance */},
5099 {"reflectedIntegralAttr", TestObjV8Internal::reflectedIntegralAttrAttributeG etterCallback, TestObjV8Internal::reflectedIntegralAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAt tribute>(v8::None), 0 /* on instance */}, 5129 {"reflectedIntegralAttr", TestObjV8Internal::reflectedIntegralAttrAttributeG etterCallback, TestObjV8Internal::reflectedIntegralAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAt tribute>(v8::None), 0 /* on instance */},
5100 {"reflectedUnsignedIntegralAttr", TestObjV8Internal::reflectedUnsignedIntegr alAttrAttributeGetterCallback, TestObjV8Internal::reflectedUnsignedIntegralAttrA ttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), st atic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 5130 {"reflectedUnsignedIntegralAttr", TestObjV8Internal::reflectedUnsignedIntegr alAttrAttributeGetterCallback, TestObjV8Internal::reflectedUnsignedIntegralAttrA ttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), st atic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5101 {"reflectedBooleanAttr", TestObjV8Internal::reflectedBooleanAttrAttributeGet terCallback, TestObjV8Internal::reflectedBooleanAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttri bute>(v8::None), 0 /* on instance */}, 5131 {"reflectedBooleanAttr", TestObjV8Internal::reflectedBooleanAttrAttributeGet terCallback, TestObjV8Internal::reflectedBooleanAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttri bute>(v8::None), 0 /* on instance */},
5102 {"reflectedURLAttr", TestObjV8Internal::reflectedURLAttrAttributeGetterCallb ack, TestObjV8Internal::reflectedURLAttrAttributeSetterCallback, 0, 0, 0, static _cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::No ne), 0 /* on instance */}, 5132 {"reflectedURLAttr", TestObjV8Internal::reflectedURLAttrAttributeGetterCallb ack, TestObjV8Internal::reflectedURLAttrAttributeSetterCallback, 0, 0, 0, static _cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::No ne), 0 /* on instance */},
5103 {"reflectedStringAttr", TestObjV8Internal::reflectedStringAttrAttributeGette rCallback, TestObjV8Internal::reflectedStringAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribut e>(v8::None), 0 /* on instance */}, 5133 {"reflectedStringAttr", TestObjV8Internal::reflectedStringAttrAttributeGette rCallback, TestObjV8Internal::reflectedStringAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribut e>(v8::None), 0 /* on instance */},
5104 {"reflectedCustomIntegralAttr", TestObjV8Internal::reflectedCustomIntegralAt trAttributeGetterCallback, TestObjV8Internal::reflectedCustomIntegralAttrAttribu teSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_c ast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 5134 {"reflectedCustomIntegralAttr", TestObjV8Internal::reflectedCustomIntegralAt trAttributeGetterCallback, TestObjV8Internal::reflectedCustomIntegralAttrAttribu teSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_c ast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5105 {"reflectedCustomBooleanAttr", TestObjV8Internal::reflectedCustomBooleanAttr AttributeGetterCallback, TestObjV8Internal::reflectedCustomBooleanAttrAttributeS etterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast <v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 5135 {"reflectedCustomBooleanAttr", TestObjV8Internal::reflectedCustomBooleanAttr AttributeGetterCallback, TestObjV8Internal::reflectedCustomBooleanAttrAttributeS etterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast <v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5106 {"reflectedCustomURLAttr", TestObjV8Internal::reflectedCustomURLAttrAttribut eGetterCallback, TestObjV8Internal::reflectedCustomURLAttrAttributeSetterCallbac k, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Propert yAttribute>(v8::None), 0 /* on instance */}, 5136 {"reflectedCustomURLAttr", TestObjV8Internal::reflectedCustomURLAttrAttribut eGetterCallback, TestObjV8Internal::reflectedCustomURLAttrAttributeSetterCallbac k, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Propert yAttribute>(v8::None), 0 /* on instance */},
5137 {"animatedReflectedAttribute", TestObjV8Internal::animatedReflectedAttribute AttributeGetterCallback, TestObjV8Internal::animatedReflectedAttributeAttributeS etterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast <v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5107 {"typedArrayAttr", TestObjV8Internal::typedArrayAttrAttributeGetterCallback, TestObjV8Internal::typedArrayAttrAttributeSetterCallback, 0, 0, 0, static_cast< v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 5138 {"typedArrayAttr", TestObjV8Internal::typedArrayAttrAttributeGetterCallback, TestObjV8Internal::typedArrayAttrAttributeSetterCallback, 0, 0, 0, static_cast< v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5108 {"attrWithGetterException", TestObjV8Internal::attrWithGetterExceptionAttrib uteGetterCallback, TestObjV8Internal::attrWithGetterExceptionAttributeSetterCall back, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Prop ertyAttribute>(v8::None), 0 /* on instance */}, 5139 {"attrWithGetterException", TestObjV8Internal::attrWithGetterExceptionAttrib uteGetterCallback, TestObjV8Internal::attrWithGetterExceptionAttributeSetterCall back, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Prop ertyAttribute>(v8::None), 0 /* on instance */},
5109 {"attrWithSetterException", TestObjV8Internal::attrWithSetterExceptionAttrib uteGetterCallback, TestObjV8Internal::attrWithSetterExceptionAttributeSetterCall back, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Prop ertyAttribute>(v8::None), 0 /* on instance */}, 5140 {"attrWithSetterException", TestObjV8Internal::attrWithSetterExceptionAttrib uteGetterCallback, TestObjV8Internal::attrWithSetterExceptionAttributeSetterCall back, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Prop ertyAttribute>(v8::None), 0 /* on instance */},
5110 {"stringAttrWithGetterException", TestObjV8Internal::stringAttrWithGetterExc eptionAttributeGetterCallback, TestObjV8Internal::stringAttrWithGetterExceptionA ttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), st atic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 5141 {"stringAttrWithGetterException", TestObjV8Internal::stringAttrWithGetterExc eptionAttributeGetterCallback, TestObjV8Internal::stringAttrWithGetterExceptionA ttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), st atic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5111 {"stringAttrWithSetterException", TestObjV8Internal::stringAttrWithSetterExc eptionAttributeGetterCallback, TestObjV8Internal::stringAttrWithSetterExceptionA ttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), st atic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 5142 {"stringAttrWithSetterException", TestObjV8Internal::stringAttrWithSetterExc eptionAttributeGetterCallback, TestObjV8Internal::stringAttrWithSetterExceptionA ttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), st atic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5112 {"customAttr", TestObjV8Internal::customAttrAttributeGetterCallback, TestObj V8Internal::customAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessCo ntrol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on insta nce */}, 5143 {"customAttr", TestObjV8Internal::customAttrAttributeGetterCallback, TestObj V8Internal::customAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessCo ntrol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on insta nce */},
5113 {"withScriptStateAttribute", TestObjV8Internal::withScriptStateAttributeAttr ibuteGetterCallback, TestObjV8Internal::withScriptStateAttributeAttributeSetterC allback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::P ropertyAttribute>(v8::None), 0 /* on instance */}, 5144 {"withScriptStateAttribute", TestObjV8Internal::withScriptStateAttributeAttr ibuteGetterCallback, TestObjV8Internal::withScriptStateAttributeAttributeSetterC allback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::P ropertyAttribute>(v8::None), 0 /* on instance */},
5114 {"withExecutionContextAttribute", TestObjV8Internal::withExecutionContextAtt ributeAttributeGetterCallback, TestObjV8Internal::withExecutionContextAttributeA ttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), st atic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 5145 {"withExecutionContextAttribute", TestObjV8Internal::withExecutionContextAtt ributeAttributeGetterCallback, TestObjV8Internal::withExecutionContextAttributeA ttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), st atic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5115 {"withActiveWindowAndFirstWindowAttribute", TestObjV8Internal::withActiveWin dowAndFirstWindowAttributeAttributeGetterCallback, TestObjV8Internal::withActive WindowAndFirstWindowAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::A ccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* o n instance */}, 5146 {"withActiveWindowAndFirstWindowAttribute", TestObjV8Internal::withActiveWin dowAndFirstWindowAttributeAttributeGetterCallback, TestObjV8Internal::withActive WindowAndFirstWindowAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::A ccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* o n instance */},
5116 {"withScriptStateAttributeRaises", TestObjV8Internal::withScriptStateAttribu teRaisesAttributeGetterCallback, TestObjV8Internal::withScriptStateAttributeRais esAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 5147 {"withScriptStateAttributeRaises", TestObjV8Internal::withScriptStateAttribu teRaisesAttributeGetterCallback, TestObjV8Internal::withScriptStateAttributeRais esAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
5435 fromInternalPointer(object)->deref(); 5466 fromInternalPointer(object)->deref();
5436 } 5467 }
5437 5468
5438 template<> 5469 template<>
5439 v8::Handle<v8::Value> toV8NoInline(TestObj* impl, v8::Handle<v8::Object> creatio nContext, v8::Isolate* isolate) 5470 v8::Handle<v8::Value> toV8NoInline(TestObj* impl, v8::Handle<v8::Object> creatio nContext, v8::Isolate* isolate)
5440 { 5471 {
5441 return toV8(impl, creationContext, isolate); 5472 return toV8(impl, creationContext, isolate);
5442 } 5473 }
5443 5474
5444 } // namespace WebCore 5475 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/idls/TestObject.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698