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

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

Issue 127903002: Empty reflected attributes and string literals in extended attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: docstring formatting Created 6 years, 11 months 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
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 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after
1112 } 1112 }
1113 1113
1114 static void limitedWithInvalidAndMissingDefaultAttributeAttributeSetterCallback( v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackI nfo<void>& info) 1114 static void limitedWithInvalidAndMissingDefaultAttributeAttributeSetterCallback( v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackI nfo<void>& info)
1115 { 1115 {
1116 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1116 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1117 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 1117 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
1118 TestObjV8Internal::limitedWithInvalidAndMissingDefaultAttributeAttributeSett er(jsValue, info); 1118 TestObjV8Internal::limitedWithInvalidAndMissingDefaultAttributeAttributeSett er(jsValue, info);
1119 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 1119 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1120 } 1120 }
1121 1121
1122 static void corsSettingAttributeAttributeGetter(const v8::PropertyCallbackInfo<v 8::Value>& info)
1123 {
1124 TestObj* imp = V8TestObject::toNative(info.Holder());
1125 String resultValue = imp->fastGetAttribute(HTMLNames::corssettingattributeAt tr);
1126 if (resultValue.isNull()) {
1127 ;
1128 } else if (resultValue.isEmpty()) {
1129 resultValue = "anonymous";
1130 } else if (equalIgnoringCase(resultValue, "anonymous")) {
1131 resultValue = "anonymous";
1132 } else if (equalIgnoringCase(resultValue, "use-credentials")) {
1133 resultValue = "use-credentials";
1134 } else {
1135 resultValue = "anonymous";
1136 }
1137 v8SetReturnValueString(info, resultValue, info.GetIsolate());
1138 }
1139
1140 static void corsSettingAttributeAttributeGetterCallback(v8::Local<v8::String>, c onst v8::PropertyCallbackInfo<v8::Value>& info)
1141 {
1142 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1143 TestObjV8Internal::corsSettingAttributeAttributeGetter(info);
1144 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1145 }
1146
1147 static void limitedWithEmptyMissingInvalidAttributeAttributeGetter(const v8::Pro pertyCallbackInfo<v8::Value>& info)
1148 {
1149 TestObj* imp = V8TestObject::toNative(info.Holder());
1150 String resultValue = imp->fastGetAttribute(HTMLNames::limitedwithemptymissin ginvalidattributeAttr);
1151 if (resultValue.isNull()) {
1152 resultValue = "missing";
1153 } else if (resultValue.isEmpty()) {
1154 resultValue = "empty";
1155 } else if (equalIgnoringCase(resultValue, "empty")) {
1156 resultValue = "empty";
1157 } else if (equalIgnoringCase(resultValue, "missing")) {
1158 resultValue = "missing";
1159 } else if (equalIgnoringCase(resultValue, "invalid")) {
1160 resultValue = "invalid";
1161 } else if (equalIgnoringCase(resultValue, "a-normal")) {
1162 resultValue = "a-normal";
1163 } else {
1164 resultValue = "invalid";
1165 }
1166 v8SetReturnValueString(info, resultValue, info.GetIsolate());
1167 }
1168
1169 static void limitedWithEmptyMissingInvalidAttributeAttributeGetterCallback(v8::L ocal<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1170 {
1171 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1172 TestObjV8Internal::limitedWithEmptyMissingInvalidAttributeAttributeGetter(in fo);
1173 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1174 }
1175
1122 static void typedArrayAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Val ue>& info) 1176 static void typedArrayAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Val ue>& info)
1123 { 1177 {
1124 TestObj* imp = V8TestObject::toNative(info.Holder()); 1178 TestObj* imp = V8TestObject::toNative(info.Holder());
1125 v8SetReturnValueFast(info, imp->typedArrayAttr(), imp); 1179 v8SetReturnValueFast(info, imp->typedArrayAttr(), imp);
1126 } 1180 }
1127 1181
1128 static void typedArrayAttrAttributeGetterCallback(v8::Local<v8::String>, const v 8::PropertyCallbackInfo<v8::Value>& info) 1182 static void typedArrayAttrAttributeGetterCallback(v8::Local<v8::String>, const v 8::PropertyCallbackInfo<v8::Value>& info)
1129 { 1183 {
1130 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1184 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1131 TestObjV8Internal::typedArrayAttrAttributeGetter(info); 1185 TestObjV8Internal::typedArrayAttrAttributeGetter(info);
(...skipping 4366 matching lines...) Expand 10 before | Expand all | Expand 10 after
5498 {"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 */}, 5552 {"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 */},
5499 {"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 */}, 5553 {"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 */},
5500 {"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 */}, 5554 {"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 */},
5501 {"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 */}, 5555 {"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 */},
5502 {"limitedToOnlyOneAttribute", TestObjV8Internal::limitedToOnlyOneAttributeAt tributeGetterCallback, TestObjV8Internal::limitedToOnlyOneAttributeAttributeSett erCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8 ::PropertyAttribute>(v8::None), 0 /* on instance */}, 5556 {"limitedToOnlyOneAttribute", TestObjV8Internal::limitedToOnlyOneAttributeAt tributeGetterCallback, TestObjV8Internal::limitedToOnlyOneAttributeAttributeSett erCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8 ::PropertyAttribute>(v8::None), 0 /* on instance */},
5503 {"limitedToOnlyAttribute", TestObjV8Internal::limitedToOnlyAttributeAttribut eGetterCallback, TestObjV8Internal::limitedToOnlyAttributeAttributeSetterCallbac k, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Propert yAttribute>(v8::None), 0 /* on instance */}, 5557 {"limitedToOnlyAttribute", TestObjV8Internal::limitedToOnlyAttributeAttribut eGetterCallback, TestObjV8Internal::limitedToOnlyAttributeAttributeSetterCallbac k, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Propert yAttribute>(v8::None), 0 /* on instance */},
5504 {"limitedToOnlyOtherAttribute", TestObjV8Internal::limitedToOnlyOtherAttribu teAttributeGetterCallback, TestObjV8Internal::limitedToOnlyOtherAttributeAttribu teSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_c ast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 5558 {"limitedToOnlyOtherAttribute", TestObjV8Internal::limitedToOnlyOtherAttribu teAttributeGetterCallback, TestObjV8Internal::limitedToOnlyOtherAttributeAttribu teSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_c ast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5505 {"limitedWithMissingDefaultAttribute", TestObjV8Internal::limitedWithMissing DefaultAttributeAttributeGetterCallback, TestObjV8Internal::limitedWithMissingDe faultAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v 8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 5559 {"limitedWithMissingDefaultAttribute", TestObjV8Internal::limitedWithMissing DefaultAttributeAttributeGetterCallback, TestObjV8Internal::limitedWithMissingDe faultAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v 8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5506 {"limitedWithInvalidMissingDefaultAttribute", TestObjV8Internal::limitedWith InvalidMissingDefaultAttributeAttributeGetterCallback, TestObjV8Internal::limite dWithInvalidMissingDefaultAttributeAttributeSetterCallback, 0, 0, 0, static_cast <v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 5560 {"limitedWithInvalidMissingDefaultAttribute", TestObjV8Internal::limitedWith InvalidMissingDefaultAttributeAttributeGetterCallback, TestObjV8Internal::limite dWithInvalidMissingDefaultAttributeAttributeSetterCallback, 0, 0, 0, static_cast <v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5507 {"limitedWithInvalidAndMissingDefaultAttribute", TestObjV8Internal::limitedW ithInvalidAndMissingDefaultAttributeAttributeGetterCallback, TestObjV8Internal:: limitedWithInvalidAndMissingDefaultAttributeAttributeSetterCallback, 0, 0, 0, st atic_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8 ::None), 0 /* on instance */}, 5561 {"limitedWithInvalidAndMissingDefaultAttribute", TestObjV8Internal::limitedW ithInvalidAndMissingDefaultAttributeAttributeGetterCallback, TestObjV8Internal:: limitedWithInvalidAndMissingDefaultAttributeAttributeSetterCallback, 0, 0, 0, st atic_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8 ::None), 0 /* on instance */},
5562 {"corsSettingAttribute", TestObjV8Internal::corsSettingAttributeAttributeGet terCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cas t<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5563 {"limitedWithEmptyMissingInvalidAttribute", TestObjV8Internal::limitedWithEm ptyMissingInvalidAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::A ccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* o n instance */},
5508 {"typedArrayAttr", TestObjV8Internal::typedArrayAttrAttributeGetterCallback, TestObjV8Internal::typedArrayAttrAttributeSetterCallback, 0, 0, 0, static_cast< v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 5564 {"typedArrayAttr", TestObjV8Internal::typedArrayAttrAttributeGetterCallback, TestObjV8Internal::typedArrayAttrAttributeSetterCallback, 0, 0, 0, static_cast< v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5509 {"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 */}, 5565 {"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 */},
5510 {"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 */}, 5566 {"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 */},
5511 {"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 */}, 5567 {"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 */},
5512 {"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 */}, 5568 {"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 */},
5513 {"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 */}, 5569 {"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 */},
5514 {"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 */}, 5570 {"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 */},
5515 {"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 */}, 5571 {"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 */},
5516 {"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 */}, 5572 {"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 */},
5517 {"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 */}, 5573 {"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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
5810 fromInternalPointer(object)->deref(); 5866 fromInternalPointer(object)->deref();
5811 } 5867 }
5812 5868
5813 template<> 5869 template<>
5814 v8::Handle<v8::Value> toV8NoInline(TestObj* impl, v8::Handle<v8::Object> creatio nContext, v8::Isolate* isolate) 5870 v8::Handle<v8::Value> toV8NoInline(TestObj* impl, v8::Handle<v8::Object> creatio nContext, v8::Isolate* isolate)
5815 { 5871 {
5816 return toV8(impl, creationContext, isolate); 5872 return toV8(impl, creationContext, isolate);
5817 } 5873 }
5818 5874
5819 } // namespace WebCore 5875 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/idls/TestObjectPython.idl ('k') | Source/bindings/tests/results/V8TestObjectPython.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698