Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index 09125e1407c1ae84921005737437dc74f79ddf0d..18025e14a076210b454a8cc4bcc2e7a3dd9d8f47 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -14039,6 +14039,41 @@ THREADED_TEST(ExternalArrayInfo) { |
} |
+void ExternalArrayLimitTestHelper(v8::ExternalArrayType array_type, int size) { |
+ v8::Handle<v8::Object> obj = v8::Object::New(); |
+ v8::V8::SetFatalErrorHandler(StoringErrorCallback); |
+ last_location = last_message = NULL; |
+ obj->SetIndexedPropertiesToExternalArrayData(NULL, array_type, size); |
+ CHECK(!obj->HasIndexedPropertiesInExternalArrayData()); |
+ CHECK_NE(NULL, last_location); |
+ CHECK_NE(NULL, last_message); |
+} |
+ |
+ |
+TEST(ExternalArrayLimits) { |
+ v8::HandleScope scope; |
+ LocalContext context; |
+ ExternalArrayLimitTestHelper(v8::kExternalByteArray, 0x40000000); |
+ ExternalArrayLimitTestHelper(v8::kExternalByteArray, 0xffffffff); |
+ ExternalArrayLimitTestHelper(v8::kExternalUnsignedByteArray, 0x40000000); |
+ ExternalArrayLimitTestHelper(v8::kExternalUnsignedByteArray, 0xffffffff); |
+ ExternalArrayLimitTestHelper(v8::kExternalShortArray, 0x40000000); |
+ ExternalArrayLimitTestHelper(v8::kExternalShortArray, 0xffffffff); |
+ ExternalArrayLimitTestHelper(v8::kExternalUnsignedShortArray, 0x40000000); |
+ ExternalArrayLimitTestHelper(v8::kExternalUnsignedShortArray, 0xffffffff); |
+ ExternalArrayLimitTestHelper(v8::kExternalIntArray, 0x40000000); |
+ ExternalArrayLimitTestHelper(v8::kExternalIntArray, 0xffffffff); |
+ ExternalArrayLimitTestHelper(v8::kExternalUnsignedIntArray, 0x40000000); |
+ ExternalArrayLimitTestHelper(v8::kExternalUnsignedIntArray, 0xffffffff); |
+ ExternalArrayLimitTestHelper(v8::kExternalFloatArray, 0x40000000); |
+ ExternalArrayLimitTestHelper(v8::kExternalFloatArray, 0xffffffff); |
+ ExternalArrayLimitTestHelper(v8::kExternalDoubleArray, 0x40000000); |
+ ExternalArrayLimitTestHelper(v8::kExternalDoubleArray, 0xffffffff); |
+ ExternalArrayLimitTestHelper(v8::kExternalPixelArray, 0x40000000); |
+ ExternalArrayLimitTestHelper(v8::kExternalPixelArray, 0xffffffff); |
+} |
+ |
+ |
THREADED_TEST(ScriptContextDependence) { |
v8::HandleScope scope; |
LocalContext c1; |