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

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

Issue 101403002: IDL compiler: Consolidate test IDL files (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: More 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
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 6267 matching lines...) Expand 10 before | Expand all | Expand 10 after
6278 {"runtimeEnabledLongAttribute", TestObjectPythonV8Internal::runtimeEnabl edLongAttributeAttributeGetterCallback, TestObjectPythonV8Internal::runtimeEnabl edLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>( v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */} ; 6278 {"runtimeEnabledLongAttribute", TestObjectPythonV8Internal::runtimeEnabl edLongAttributeAttributeGetterCallback, TestObjectPythonV8Internal::runtimeEnabl edLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>( v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */} ;
6279 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate , attributeConfiguration, isolate, currentWorldType); 6279 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate , attributeConfiguration, isolate, currentWorldType);
6280 } 6280 }
6281 #if ENABLE(CONDITION) 6281 #if ENABLE(CONDITION)
6282 if (RuntimeEnabledFeatures::featureNameEnabled()) { 6282 if (RuntimeEnabledFeatures::featureNameEnabled()) {
6283 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu ration =\ 6283 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu ration =\
6284 {"conditionalRuntimeEnabledLongAttribute", TestObjectPythonV8Internal::c onditionalRuntimeEnabledLongAttributeAttributeGetterCallback, TestObjectPythonV8 Internal::conditionalRuntimeEnabledLongAttributeAttributeSetterCallback, 0, 0, 0 , static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute >(v8::None), 0 /* on instance */}; 6284 {"conditionalRuntimeEnabledLongAttribute", TestObjectPythonV8Internal::c onditionalRuntimeEnabledLongAttributeAttributeGetterCallback, TestObjectPythonV8 Internal::conditionalRuntimeEnabledLongAttributeAttributeSetterCallback, 0, 0, 0 , static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute >(v8::None), 0 /* on instance */};
6285 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate , attributeConfiguration, isolate, currentWorldType); 6285 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate , attributeConfiguration, isolate, currentWorldType);
6286 } 6286 }
6287 #endif // ENABLE(CONDITION) 6287 #endif // ENABLE(CONDITION)
6288 static const V8DOMConfiguration::ConstantConfiguration V8TestObjectPythonCon stants[] = {
6289 {"CONST_VALUE_0", 0},
6290 {"CONST_VALUE_1", 1},
6291 {"CONST_VALUE_2", 2},
6292 {"CONST_VALUE_4", 4},
6293 {"CONST_VALUE_8", 8},
6294 {"CONST_VALUE_9", -1},
6295 {"CONST_VALUE_10", "my constant string"},
6296 {"CONST_VALUE_11", 0xffffffff},
6297 {"CONST_VALUE_12", 0x01},
6298 {"CONST_VALUE_13", 0X20},
6299 {"CONST_VALUE_14", 0x1abc},
6300 {"CONST_VALUE_15", 010},
6301 {"CONST_VALUE_16", -010},
6302 {"CONST_VALUE_16", -0x1A},
6303 {"CONST_VALUE_17", -0X1a},
6304 {"DEPRECATED_CONSTANT", 1},
6305 {"CONST_JAVASCRIPT", 1},
6306 };
6307 V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8 TestObjectPythonConstants, WTF_ARRAY_LENGTH(V8TestObjectPythonConstants), isolat e);
6308 if (RuntimeEnabledFeatures::featureNameEnabled()) {
6309 static const V8DOMConfiguration::ConstantConfiguration constantConfigura tion = {"FEATURE_ENABLED_CONST", static_cast<signed int>(1)};
6310 V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate , &constantConfiguration, 1, isolate);
6311 }
6312 COMPILE_ASSERT(0 == TestObjectPython::CONST_VALUE_0, TheValueOfTestObjectPyt hon_CONST_VALUE_0DoesntMatchWithImplementation);
6313 COMPILE_ASSERT(1 == TestObjectPython::CONST_VALUE_1, TheValueOfTestObjectPyt hon_CONST_VALUE_1DoesntMatchWithImplementation);
6314 COMPILE_ASSERT(2 == TestObjectPython::CONST_VALUE_2, TheValueOfTestObjectPyt hon_CONST_VALUE_2DoesntMatchWithImplementation);
6315 COMPILE_ASSERT(4 == TestObjectPython::CONST_VALUE_4, TheValueOfTestObjectPyt hon_CONST_VALUE_4DoesntMatchWithImplementation);
6316 COMPILE_ASSERT(8 == TestObjectPython::CONST_VALUE_8, TheValueOfTestObjectPyt hon_CONST_VALUE_8DoesntMatchWithImplementation);
6317 COMPILE_ASSERT(-1 == TestObjectPython::CONST_VALUE_9, TheValueOfTestObjectPy thon_CONST_VALUE_9DoesntMatchWithImplementation);
6318 COMPILE_ASSERT("my constant string" == TestObjectPython::CONST_VALUE_10, The ValueOfTestObjectPython_CONST_VALUE_10DoesntMatchWithImplementation);
6319 COMPILE_ASSERT(0xffffffff == TestObjectPython::CONST_VALUE_11, TheValueOfTes tObjectPython_CONST_VALUE_11DoesntMatchWithImplementation);
6320 COMPILE_ASSERT(0x01 == TestObjectPython::CONST_VALUE_12, TheValueOfTestObjec tPython_CONST_VALUE_12DoesntMatchWithImplementation);
6321 COMPILE_ASSERT(0X20 == TestObjectPython::CONST_VALUE_13, TheValueOfTestObjec tPython_CONST_VALUE_13DoesntMatchWithImplementation);
6322 COMPILE_ASSERT(0x1abc == TestObjectPython::CONST_VALUE_14, TheValueOfTestObj ectPython_CONST_VALUE_14DoesntMatchWithImplementation);
6323 COMPILE_ASSERT(010 == TestObjectPython::CONST_VALUE_15, TheValueOfTestObject Python_CONST_VALUE_15DoesntMatchWithImplementation);
6324 COMPILE_ASSERT(-010 == TestObjectPython::CONST_VALUE_16, TheValueOfTestObjec tPython_CONST_VALUE_16DoesntMatchWithImplementation);
6325 COMPILE_ASSERT(-0x1A == TestObjectPython::CONST_VALUE_16, TheValueOfTestObje ctPython_CONST_VALUE_16DoesntMatchWithImplementation);
6326 COMPILE_ASSERT(-0X1a == TestObjectPython::CONST_VALUE_17, TheValueOfTestObje ctPython_CONST_VALUE_17DoesntMatchWithImplementation);
6327 COMPILE_ASSERT(1 == TestObjectPython::DEPRECATED_CONSTANT, TheValueOfTestObj ectPython_DEPRECATED_CONSTANTDoesntMatchWithImplementation);
6328 COMPILE_ASSERT(1 == TestObjectPython::FEATURE_ENABLED_CONST, TheValueOfTestO bjectPython_FEATURE_ENABLED_CONSTDoesntMatchWithImplementation);
6329 COMPILE_ASSERT(1 == TestObjectPython::CONST_IMPL, TheValueOfTestObjectPython _CONST_IMPLDoesntMatchWithImplementation);
6288 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "staticVoidMethod", v 8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPy thonV8Internal::staticVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Sig nature>(), 0)); 6330 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "staticVoidMethod", v 8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPy thonV8Internal::staticVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Sig nature>(), 0));
6289 6331
6290 // Custom Signature 'voidMethodTestInterfaceEmptyArg' 6332 // Custom Signature 'voidMethodTestInterfaceEmptyArg'
6291 const int voidMethodTestInterfaceEmptyArgArgc = 1; 6333 const int voidMethodTestInterfaceEmptyArgArgc = 1;
6292 v8::Handle<v8::FunctionTemplate> voidMethodTestInterfaceEmptyArgArgv[voidMet hodTestInterfaceEmptyArgArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(& V8TestInterfaceEmpty::wrapperTypeInfo, currentWorldType) }; 6334 v8::Handle<v8::FunctionTemplate> voidMethodTestInterfaceEmptyArgArgv[voidMet hodTestInterfaceEmptyArgArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(& V8TestInterfaceEmpty::wrapperTypeInfo, currentWorldType) };
6293 v8::Handle<v8::Signature> voidMethodTestInterfaceEmptyArgSignature = v8::Sig nature::New(isolate, functionTemplate, voidMethodTestInterfaceEmptyArgArgc, void MethodTestInterfaceEmptyArgArgv); 6335 v8::Handle<v8::Signature> voidMethodTestInterfaceEmptyArgSignature = v8::Sig nature::New(isolate, functionTemplate, voidMethodTestInterfaceEmptyArgArgc, void MethodTestInterfaceEmptyArgArgv);
6294 prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "voidMethodTestInter faceEmptyArg", v8::String::kInternalizedString), v8::FunctionTemplate::New(isola te, TestObjectPythonV8Internal::voidMethodTestInterfaceEmptyArgMethodCallback, v 8Undefined(), voidMethodTestInterfaceEmptyArgSignature, 1)); 6336 prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "voidMethodTestInter faceEmptyArg", v8::String::kInternalizedString), v8::FunctionTemplate::New(isola te, TestObjectPythonV8Internal::voidMethodTestInterfaceEmptyArgMethodCallback, v 8Undefined(), voidMethodTestInterfaceEmptyArgSignature, 1));
6295 6337
6296 // Custom Signature 'voidMethodLongArgTestInterfaceEmptyArg' 6338 // Custom Signature 'voidMethodLongArgTestInterfaceEmptyArg'
6297 const int voidMethodLongArgTestInterfaceEmptyArgArgc = 2; 6339 const int voidMethodLongArgTestInterfaceEmptyArgArgc = 2;
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
6497 fromInternalPointer(object)->deref(); 6539 fromInternalPointer(object)->deref();
6498 } 6540 }
6499 6541
6500 template<> 6542 template<>
6501 v8::Handle<v8::Value> toV8NoInline(TestObjectPython* impl, v8::Handle<v8::Object > creationContext, v8::Isolate* isolate) 6543 v8::Handle<v8::Value> toV8NoInline(TestObjectPython* impl, v8::Handle<v8::Object > creationContext, v8::Isolate* isolate)
6502 { 6544 {
6503 return toV8(impl, creationContext, isolate); 6545 return toV8(impl, creationContext, isolate);
6504 } 6546 }
6505 6547
6506 } // namespace WebCore 6548 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698