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

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

Issue 1084513002: Expose ArrayBufferView::HasBuffer (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 dc1bca2e0a241b4e4d02e92f2a783e4793b92591..966edb720ee5b7c03b97e3d2e919209505558f0d 100644
--- a/test/cctest/test-typedarrays.cc
+++ b/test/cctest/test-typedarrays.cc
@@ -19,22 +19,11 @@ void TestArrayBufferViewContents(LocalContext& env, bool should_use_buffer) {
CHECK(obj_a->IsArrayBufferView());
v8::Local<v8::ArrayBufferView> array_buffer_view =
v8::Local<v8::ArrayBufferView>::Cast(obj_a);
- Handle<JSArrayBufferView> internal_view(
- v8::Utils::OpenHandle(*array_buffer_view));
- bool has_buffer = true;
- if (internal_view->IsJSTypedArray()) {
- Handle<JSTypedArray> typed_array(JSTypedArray::cast(*internal_view));
- has_buffer = !typed_array->buffer()->IsSmi();
- }
- CHECK_EQ(has_buffer, should_use_buffer);
+ CHECK_EQ(array_buffer_view->HasBuffer(), should_use_buffer);
unsigned char contents[4] = {23, 23, 23, 23};
CHECK_EQ(sizeof(contents),
array_buffer_view->CopyContents(contents, sizeof(contents)));
- if (!has_buffer) {
- CHECK(internal_view->IsJSTypedArray());
- Handle<JSTypedArray> typed_array(JSTypedArray::cast(*internal_view));
- CHECK(typed_array->buffer()->IsSmi());
- }
+ CHECK_EQ(array_buffer_view->HasBuffer(), should_use_buffer);
for (size_t i = 0; i < sizeof(contents); ++i) {
CHECK_EQ(i, contents[i]);
}
« 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