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

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: 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 2829 matching lines...) Expand 10 before | Expand all | Expand 10 after
2881 imp->setHrefThrows(cppValue); 2882 imp->setHrefThrows(cppValue);
2882 } 2883 }
2883 2884
2884 static void locationWithExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 2885 static void locationWithExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2885 { 2886 {
2886 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2887 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2887 TestObjV8Internal::locationWithExceptionAttributeSetter(jsValue, info); 2888 TestObjV8Internal::locationWithExceptionAttributeSetter(jsValue, info);
2888 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 2889 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2889 } 2890 }
2890 2891
2892 static void animatedReflectedAttributeAttributeGetter(const v8::PropertyCallback Info<v8::Value>& info)
2893 {
2894 TestObj* imp = V8TestObject::toNative(info.Holder());
2895 v8SetReturnValueFast(info, imp->getAttribute(HTMLNames::animatedreflectedatt ributeAttr), imp);
Inactive 2013/12/14 04:18:41 Calling getAttribute(), as expected.
2896 }
2897
2898 static void animatedReflectedAttributeAttributeGetterCallback(v8::Local<v8::Stri ng>, const v8::PropertyCallbackInfo<v8::Value>& info)
2899 {
2900 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2901 TestObjV8Internal::animatedReflectedAttributeAttributeGetter(info);
2902 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2903 }
2904
2905 static void animatedReflectedAttributeAttributeSetter(v8::Local<v8::Value> jsVal ue, const v8::PropertyCallbackInfo<void>& info)
2906 {
2907 TestObj* imp = V8TestObject::toNative(info.Holder());
2908 V8TRYCATCH_VOID(SVGAnimatedString*, cppValue, V8SVGAnimatedString::hasInstan ce(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGAnimatedStri ng::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
2909 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
2910 imp->setAttribute(HTMLNames::animatedreflectedattributeAttr, WTF::getPtr(cpp Value));
2911 }
2912
2913 static void animatedReflectedAttributeAttributeSetterCallback(v8::Local<v8::Stri ng>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2914 {
2915 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2916 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
2917 TestObjV8Internal::animatedReflectedAttributeAttributeSetter(jsValue, info);
2918 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2919 }
2920
2891 static void TestObjConstructorGetter(v8::Local<v8::String>, const v8::PropertyCa llbackInfo<v8::Value>& info) 2921 static void TestObjConstructorGetter(v8::Local<v8::String>, const v8::PropertyCa llbackInfo<v8::Value>& info)
2892 { 2922 {
2893 v8::Handle<v8::Value> data = info.Data(); 2923 v8::Handle<v8::Value> data = info.Data();
2894 ASSERT(data->IsExternal()); 2924 ASSERT(data->IsExternal());
2895 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->Cre ationContext()); 2925 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->Cre ationContext());
2896 if (!perContextData) 2926 if (!perContextData)
2897 return; 2927 return;
2898 v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::u nwrap(data))); 2928 v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::u nwrap(data)));
2899 } 2929 }
2900 2930
(...skipping 2272 matching lines...) Expand 10 before | Expand all | Expand 10 after
5173 {"activityLoggedAttrSetter1", TestObjV8Internal::activityLoggedAttrSetter1At tributeGetterCallback, TestObjV8Internal::activityLoggedAttrSetter1AttributeSett erCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8 ::PropertyAttribute>(v8::None), 0 /* on instance */}, 5203 {"activityLoggedAttrSetter1", TestObjV8Internal::activityLoggedAttrSetter1At tributeGetterCallback, TestObjV8Internal::activityLoggedAttrSetter1AttributeSett erCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8 ::PropertyAttribute>(v8::None), 0 /* on instance */},
5174 {"activityLoggedAttrSetter2", TestObjV8Internal::activityLoggedAttrSetter2At tributeGetterCallback, TestObjV8Internal::activityLoggedAttrSetter2AttributeSett erCallback, TestObjV8Internal::activityLoggedAttrSetter2AttributeGetterCallbackF orMainWorld, TestObjV8Internal::activityLoggedAttrSetter2AttributeSetterCallback ForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pr opertyAttribute>(v8::None), 0 /* on instance */}, 5204 {"activityLoggedAttrSetter2", TestObjV8Internal::activityLoggedAttrSetter2At tributeGetterCallback, TestObjV8Internal::activityLoggedAttrSetter2AttributeSett erCallback, TestObjV8Internal::activityLoggedAttrSetter2AttributeGetterCallbackF orMainWorld, TestObjV8Internal::activityLoggedAttrSetter2AttributeSetterCallback ForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pr opertyAttribute>(v8::None), 0 /* on instance */},
5175 {"activityLoggedInIsolatedWorldsAttrSetter", TestObjV8Internal::activityLogg edInIsolatedWorldsAttrSetterAttributeGetterCallback, TestObjV8Internal::activity LoggedInIsolatedWorldsAttrSetterAttributeSetterCallback, TestObjV8Internal::acti vityLoggedInIsolatedWorldsAttrSetterAttributeGetterCallbackForMainWorld, TestObj V8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeSetterCallbackForMa inWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Propert yAttribute>(v8::None), 0 /* on instance */}, 5205 {"activityLoggedInIsolatedWorldsAttrSetter", TestObjV8Internal::activityLogg edInIsolatedWorldsAttrSetterAttributeGetterCallback, TestObjV8Internal::activity LoggedInIsolatedWorldsAttrSetterAttributeSetterCallback, TestObjV8Internal::acti vityLoggedInIsolatedWorldsAttrSetterAttributeGetterCallbackForMainWorld, TestObj V8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeSetterCallbackForMa inWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Propert yAttribute>(v8::None), 0 /* on instance */},
5176 {"activityLoggedAttrGetter1", TestObjV8Internal::activityLoggedAttrGetter1At tributeGetterCallback, TestObjV8Internal::activityLoggedAttrGetter1AttributeSett erCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8 ::PropertyAttribute>(v8::None), 0 /* on instance */}, 5206 {"activityLoggedAttrGetter1", TestObjV8Internal::activityLoggedAttrGetter1At tributeGetterCallback, TestObjV8Internal::activityLoggedAttrGetter1AttributeSett erCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8 ::PropertyAttribute>(v8::None), 0 /* on instance */},
5177 {"activityLoggedAttrGetter2", TestObjV8Internal::activityLoggedAttrGetter2At tributeGetterCallback, TestObjV8Internal::activityLoggedAttrGetter2AttributeSett erCallback, TestObjV8Internal::activityLoggedAttrGetter2AttributeGetterCallbackF orMainWorld, TestObjV8Internal::activityLoggedAttrGetter2AttributeSetterCallback ForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pr opertyAttribute>(v8::None), 0 /* on instance */}, 5207 {"activityLoggedAttrGetter2", TestObjV8Internal::activityLoggedAttrGetter2At tributeGetterCallback, TestObjV8Internal::activityLoggedAttrGetter2AttributeSett erCallback, TestObjV8Internal::activityLoggedAttrGetter2AttributeGetterCallbackF orMainWorld, TestObjV8Internal::activityLoggedAttrGetter2AttributeSetterCallback ForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pr opertyAttribute>(v8::None), 0 /* on instance */},
5178 {"activityLoggedInIsolatedWorldsAttrGetter", TestObjV8Internal::activityLogg edInIsolatedWorldsAttrGetterAttributeGetterCallback, TestObjV8Internal::activity LoggedInIsolatedWorldsAttrGetterAttributeSetterCallback, TestObjV8Internal::acti vityLoggedInIsolatedWorldsAttrGetterAttributeGetterCallbackForMainWorld, TestObj V8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeSetterCallbackForMa inWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Propert yAttribute>(v8::None), 0 /* on instance */}, 5208 {"activityLoggedInIsolatedWorldsAttrGetter", TestObjV8Internal::activityLogg edInIsolatedWorldsAttrGetterAttributeGetterCallback, TestObjV8Internal::activity LoggedInIsolatedWorldsAttrGetterAttributeSetterCallback, TestObjV8Internal::acti vityLoggedInIsolatedWorldsAttrGetterAttributeGetterCallbackForMainWorld, TestObj V8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeSetterCallbackForMa inWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Propert yAttribute>(v8::None), 0 /* on instance */},
5179 {"deprecatedReadonlyAttr", TestObjV8Internal::deprecatedReadonlyAttrAttribut eGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static _cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 5209 {"deprecatedReadonlyAttr", TestObjV8Internal::deprecatedReadonlyAttrAttribut eGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static _cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5180 {"deprecatedAttr", TestObjV8Internal::deprecatedAttrAttributeGetterCallback, TestObjV8Internal::deprecatedAttrAttributeSetterCallback, 0, 0, 0, static_cast< v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 5210 {"deprecatedAttr", TestObjV8Internal::deprecatedAttrAttributeGetterCallback, TestObjV8Internal::deprecatedAttrAttributeSetterCallback, 0, 0, 0, static_cast< v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5181 {"location", TestObjV8Internal::locationAttributeGetterCallback, TestObjV8In ternal::locationAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl> (v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */ }, 5211 {"location", TestObjV8Internal::locationAttributeGetterCallback, TestObjV8In ternal::locationAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl> (v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */ },
5182 {"locationWithException", TestObjV8Internal::locationWithExceptionAttributeG etterCallback, TestObjV8Internal::locationWithExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAt tribute>(v8::None), 0 /* on instance */}, 5212 {"locationWithException", TestObjV8Internal::locationWithExceptionAttributeG etterCallback, TestObjV8Internal::locationWithExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAt tribute>(v8::None), 0 /* on instance */},
5213 {"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 */},
5183 }; 5214 };
5184 5215
5185 static const V8DOMConfiguration::AccessorConfiguration V8TestObjectAccessors[] = { 5216 static const V8DOMConfiguration::AccessorConfiguration V8TestObjectAccessors[] = {
5186 {"attrWithJSGetterAndSetter", TestObjV8Internal::attrWithJSGetterAndSetterAt tributeGetterCallback, TestObjV8Internal::attrWithJSGetterAndSetterAttributeSett erCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8 ::PropertyAttribute>(v8::None)}, 5217 {"attrWithJSGetterAndSetter", TestObjV8Internal::attrWithJSGetterAndSetterAt tributeGetterCallback, TestObjV8Internal::attrWithJSGetterAndSetterAttributeSett erCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8 ::PropertyAttribute>(v8::None)},
5187 }; 5218 };
5188 5219
5189 static const V8DOMConfiguration::MethodConfiguration V8TestObjectMethods[] = { 5220 static const V8DOMConfiguration::MethodConfiguration V8TestObjectMethods[] = {
5190 {"voidMethod", TestObjV8Internal::voidMethodMethodCallback, 0, 0}, 5221 {"voidMethod", TestObjV8Internal::voidMethodMethodCallback, 0, 0},
5191 {"voidMethodWithArgs", TestObjV8Internal::voidMethodWithArgsMethodCallback, 0, 3}, 5222 {"voidMethodWithArgs", TestObjV8Internal::voidMethodWithArgsMethodCallback, 0, 3},
5192 {"longMethod", TestObjV8Internal::longMethodMethodCallback, 0, 0}, 5223 {"longMethod", TestObjV8Internal::longMethodMethodCallback, 0, 0},
(...skipping 242 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