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

Unified Diff: test/cctest/test-typedarrays.cc

Issue 1095083002: Allow for accessing an ArrayBuffer contents without externalizing it (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-typedarrays.cc
diff --git a/test/cctest/test-typedarrays.cc b/test/cctest/test-typedarrays.cc
index 966edb720ee5b7c03b97e3d2e919209505558f0d..d031048caeb833adc7b7e15dd3d4dc242e6e338b 100644
--- a/test/cctest/test-typedarrays.cc
+++ b/test/cctest/test-typedarrays.cc
@@ -10,6 +10,7 @@
#include "src/api.h"
#include "src/heap/heap.h"
#include "src/objects.h"
+#include "src/v8.h"
using namespace v8::internal;
@@ -66,3 +67,15 @@ TEST(CopyContentsView) {
"var a = new DataView(b, 2);");
TestArrayBufferViewContents(env, true);
}
+
+
+TEST(AllocateNotExternal) {
+ LocalContext env;
+ v8::HandleScope scope(env->GetIsolate());
+ void* memory = V8::ArrayBufferAllocator()->Allocate(1024);
+ v8::Local<v8::ArrayBuffer> buffer =
+ v8::ArrayBuffer::New(env->GetIsolate(), memory, 1024,
+ v8::ArrayBufferCreationMode::kInternalized);
+ CHECK(!buffer->IsExternal());
+ CHECK_EQ(memory, buffer->GetContents().Data());
+}
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698