| Index: runtime/vm/dart_api_impl_test.cc
|
| diff --git a/runtime/vm/dart_api_impl_test.cc b/runtime/vm/dart_api_impl_test.cc
|
| index 9fe96ae2f070cf54890e12d7738af7e03e684e65..4b0b5d51fccaf47a031352c86564b57888497486 100644
|
| --- a/runtime/vm/dart_api_impl_test.cc
|
| +++ b/runtime/vm/dart_api_impl_test.cc
|
| @@ -1417,6 +1417,29 @@ TEST_CASE(TypedDataViewListGetAsBytes) {
|
| }
|
|
|
|
|
| +TEST_CASE(TypedDataViewListIsTypedData) {
|
| + const int kSize = 1000;
|
| +
|
| + const char* kScriptChars =
|
| + "import 'dart:typed_data';\n"
|
| + "List main(int size) {\n"
|
| + " var a = new Int8List(size);\n"
|
| + " var view = new Int8List.view(a.buffer, 0, size);\n"
|
| + " return view;\n"
|
| + "}\n";
|
| + // Create a test library and Load up a test script in it.
|
| + Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
|
| +
|
| + // Create a typed data view object.
|
| + Dart_Handle dart_args[1];
|
| + dart_args[0] = Dart_NewInteger(kSize);
|
| + Dart_Handle view_obj = Dart_Invoke(lib, NewString("main"), 1, dart_args);
|
| + EXPECT_VALID(view_obj);
|
| + // Test that the API considers it a TypedData object.
|
| + EXPECT(Dart_IsTypedData(view_obj));
|
| +}
|
| +
|
| +
|
| TEST_CASE(TypedDataAccess) {
|
| EXPECT_EQ(Dart_TypedData_kInvalid,
|
| Dart_GetTypeOfTypedData(Dart_True()));
|
|
|