| Index: test/cctest/test-api.cc
|
| diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
|
| index cd2641270ff11578eeeae8d9b147785da30b73c8..8ac41fb860e4acf6a6a3e40c234439ed3d098a10 100644
|
| --- a/test/cctest/test-api.cc
|
| +++ b/test/cctest/test-api.cc
|
| @@ -10549,8 +10549,8 @@ THREADED_TEST(PixelArray) {
|
| LocalContext context;
|
| const int kElementCount = 260;
|
| uint8_t* pixel_data = reinterpret_cast<uint8_t*>(malloc(kElementCount));
|
| - i::Handle<i::PixelArray> pixels = i::Factory::NewPixelArray(kElementCount,
|
| - pixel_data);
|
| + i::Handle<i::ExternalPixelArray> pixels =
|
| + i::Factory::NewExternalPixelArray(kElementCount, pixel_data);
|
| i::Heap::CollectAllGarbage(false); // Force GC to trigger verification.
|
| for (int i = 0; i < kElementCount; i++) {
|
| pixels->set(i, i % 256);
|
| @@ -10890,7 +10890,7 @@ THREADED_TEST(PixelArray) {
|
| " return sum; "
|
| "}"
|
| "for (var i = 0; i < 256; ++i) { pixels[i] = i; }"
|
| - "for (var i = 0; i < 10000; ++i) {"
|
| + "for (var i = 0; i < 5000; ++i) {"
|
| " result = pa_load(pixels);"
|
| "}"
|
| "result");
|
| @@ -10907,7 +10907,7 @@ THREADED_TEST(PixelArray) {
|
| " }"
|
| " return sum; "
|
| "}"
|
| - "for (var i = 0; i < 100000; ++i) {"
|
| + "for (var i = 0; i < 5000; ++i) {"
|
| " pa_init(pixels);"
|
| "}"
|
| "result = pa_load(pixels);"
|
| @@ -10955,8 +10955,8 @@ THREADED_TEST(PixelArrayWithInterceptor) {
|
| LocalContext context;
|
| const int kElementCount = 260;
|
| uint8_t* pixel_data = reinterpret_cast<uint8_t*>(malloc(kElementCount));
|
| - i::Handle<i::PixelArray> pixels =
|
| - i::Factory::NewPixelArray(kElementCount, pixel_data);
|
| + i::Handle<i::ExternalPixelArray> pixels =
|
| + i::Factory::NewExternalPixelArray(kElementCount, pixel_data);
|
| for (int i = 0; i < kElementCount; i++) {
|
| pixels->set(i, i % 256);
|
| }
|
| @@ -10984,6 +10984,7 @@ static int ExternalArrayElementSize(v8::ExternalArrayType array_type) {
|
| switch (array_type) {
|
| case v8::kExternalByteArray:
|
| case v8::kExternalUnsignedByteArray:
|
| + case v8::kExternalPixelArray:
|
| return 1;
|
| break;
|
| case v8::kExternalShortArray:
|
| @@ -11374,6 +11375,14 @@ THREADED_TEST(ExternalUnsignedByteArray) {
|
| }
|
|
|
|
|
| +THREADED_TEST(ExternalPixelArray) {
|
| + ExternalArrayTestHelper<i::ExternalPixelArray, uint8_t>(
|
| + v8::kExternalPixelArray,
|
| + 0,
|
| + 255);
|
| +}
|
| +
|
| +
|
| THREADED_TEST(ExternalShortArray) {
|
| ExternalArrayTestHelper<i::ExternalShortArray, int16_t>(
|
| v8::kExternalShortArray,
|
| @@ -11451,6 +11460,7 @@ THREADED_TEST(ExternalArrayInfo) {
|
| ExternalArrayInfoTestHelper(v8::kExternalIntArray);
|
| ExternalArrayInfoTestHelper(v8::kExternalUnsignedIntArray);
|
| ExternalArrayInfoTestHelper(v8::kExternalFloatArray);
|
| + ExternalArrayInfoTestHelper(v8::kExternalPixelArray);
|
| }
|
|
|
|
|
|
|