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

Side by Side Diff: runtime/vm/debugger_api_impl_test.cc

Issue 20575003: Fix for issue 12136 (do not try to copy type arguments if the base class (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "include/dart_debugger_api.h" 5 #include "include/dart_debugger_api.h"
6 #include "platform/assert.h" 6 #include "platform/assert.h"
7 #include "vm/dart_api_impl.h" 7 #include "vm/dart_api_impl.h"
8 #include "vm/thread.h" 8 #include "vm/thread.h"
9 #include "vm/unit_test.h" 9 #include "vm/unit_test.h"
10 10
(...skipping 1444 matching lines...) Expand 10 before | Expand all | Expand 10 after
1455 "class Test1 extends Test {\n" 1455 "class Test1 extends Test {\n"
1456 "}\n" 1456 "}\n"
1457 "class Test2<T> {\n" 1457 "class Test2<T> {\n"
1458 "}\n" 1458 "}\n"
1459 "class Test3 extends Test2<int> {\n" 1459 "class Test3 extends Test2<int> {\n"
1460 "}\n" 1460 "}\n"
1461 "class Test4<A, B> extends Test2<A> {\n" 1461 "class Test4<A, B> extends Test2<A> {\n"
1462 "}\n" 1462 "}\n"
1463 "class Test5<A, B, C> extends Test4<A, B> {\n" 1463 "class Test5<A, B, C> extends Test4<A, B> {\n"
1464 "}\n" 1464 "}\n"
1465 "var s = new Set();\n"
1465 "int main() {\n" 1466 "int main() {\n"
1466 "}\n"; 1467 "}\n";
1467 1468
1468 Isolate* isolate = Isolate::Current(); 1469 Isolate* isolate = Isolate::Current();
1469 LoadScript(kScriptChars); 1470 LoadScript(kScriptChars);
1470 ASSERT(script_lib != NULL); 1471 ASSERT(script_lib != NULL);
1471 ASSERT(Dart_IsLibrary(script_lib)); 1472 ASSERT(Dart_IsLibrary(script_lib));
1472 Dart_Handle core_lib = Dart_LookupLibrary(NewString("dart:core")); 1473 Dart_Handle core_lib = Dart_LookupLibrary(NewString("dart:core"));
1473 1474
1474 Dart_Handle Test_name = Dart_NewStringFromCString("Test"); 1475 Dart_Handle Test_name = Dart_NewStringFromCString("Test");
1475 Dart_Handle Test1_name = Dart_NewStringFromCString("Test1"); 1476 Dart_Handle Test1_name = Dart_NewStringFromCString("Test1");
1476 Dart_Handle Test2_name = Dart_NewStringFromCString("Test2"); 1477 Dart_Handle Test2_name = Dart_NewStringFromCString("Test2");
1477 Dart_Handle Test3_name = Dart_NewStringFromCString("Test3"); 1478 Dart_Handle Test3_name = Dart_NewStringFromCString("Test3");
1478 Dart_Handle Test4_name = Dart_NewStringFromCString("Test4"); 1479 Dart_Handle Test4_name = Dart_NewStringFromCString("Test4");
1479 Dart_Handle Test5_name = Dart_NewStringFromCString("Test5"); 1480 Dart_Handle Test5_name = Dart_NewStringFromCString("Test5");
1480 Dart_Handle object_name = Dart_NewStringFromCString("Object"); 1481 Dart_Handle object_name = Dart_NewStringFromCString("Object");
1481 Dart_Handle int_name = Dart_NewStringFromCString("int"); 1482 Dart_Handle int_name = Dart_NewStringFromCString("int");
1483 Dart_Handle set_name = Dart_NewStringFromCString("Set");
1484 Dart_Handle iterable_name = Dart_NewStringFromCString("IterableBase");
1482 1485
1483 Dart_Handle object_type = Dart_GetType(core_lib, object_name, 0, NULL); 1486 Dart_Handle object_type = Dart_GetType(core_lib, object_name, 0, NULL);
1484 Dart_Handle int_type = Dart_GetType(core_lib, int_name, 0, NULL); 1487 Dart_Handle int_type = Dart_GetType(core_lib, int_name, 0, NULL);
1485 EXPECT_VALID(int_type); 1488 EXPECT_VALID(int_type);
1486 Dart_Handle Test_type = Dart_GetType(script_lib, Test_name, 0, NULL); 1489 Dart_Handle Test_type = Dart_GetType(script_lib, Test_name, 0, NULL);
1487 Dart_Handle Test1_type = Dart_GetType(script_lib, Test1_name, 0, NULL); 1490 Dart_Handle Test1_type = Dart_GetType(script_lib, Test1_name, 0, NULL);
1488 Dart_Handle type_args = Dart_NewList(1); 1491 Dart_Handle type_args = Dart_NewList(1);
1489 Dart_ListSetAt(type_args, 0, int_type); 1492 Dart_ListSetAt(type_args, 0, int_type);
1490 Dart_Handle Test2_int_type = Dart_GetType(script_lib, 1493 Dart_Handle Test2_int_type = Dart_GetType(script_lib,
1491 Test2_name, 1494 Test2_name,
1492 1, 1495 1,
1493 &type_args); 1496 &type_args);
1494 Dart_Handle Test3_type = Dart_GetType(script_lib, Test3_name, 0, NULL); 1497 Dart_Handle Test3_type = Dart_GetType(script_lib, Test3_name, 0, NULL);
1495 type_args = Dart_NewList(2); 1498 type_args = Dart_NewList(2);
1496 Dart_ListSetAt(type_args, 0, int_type); 1499 Dart_ListSetAt(type_args, 0, int_type);
1497 Dart_ListSetAt(type_args, 1, int_type); 1500 Dart_ListSetAt(type_args, 1, Test_type);
1498 Dart_Handle Test4_int_type = Dart_GetType(script_lib, 1501 Dart_Handle Test4_int_type = Dart_GetType(script_lib,
1499 Test4_name, 1502 Test4_name,
1500 2, 1503 2,
1501 &type_args); 1504 &type_args);
1502 type_args = Dart_NewList(3); 1505 type_args = Dart_NewList(3);
1503 Dart_ListSetAt(type_args, 0, int_type); 1506 Dart_ListSetAt(type_args, 0, int_type);
1504 Dart_ListSetAt(type_args, 1, int_type); 1507 Dart_ListSetAt(type_args, 1, Test_type);
1505 Dart_ListSetAt(type_args, 2, int_type); 1508 Dart_ListSetAt(type_args, 2, int_type);
1506 Dart_Handle Test5_int_type = Dart_GetType(script_lib, 1509 Dart_Handle Test5_int_type = Dart_GetType(script_lib,
1507 Test5_name, 1510 Test5_name,
1508 3, 1511 3,
1509 &type_args); 1512 &type_args);
1510 { 1513 {
1511 Dart_Handle super_type = Dart_GetSupertype(object_type); 1514 Dart_Handle super_type = Dart_GetSupertype(object_type);
1512 EXPECT(super_type == Dart_Null()); 1515 EXPECT(super_type == Dart_Null());
1513 } 1516 }
1514 { 1517 {
(...skipping 13 matching lines...) Expand all
1528 const Type& expected_type = Api::UnwrapTypeHandle(isolate, Test2_int_type); 1531 const Type& expected_type = Api::UnwrapTypeHandle(isolate, Test2_int_type);
1529 const Type& actual_type = Api::UnwrapTypeHandle(isolate, super_type); 1532 const Type& actual_type = Api::UnwrapTypeHandle(isolate, super_type);
1530 EXPECT(expected_type.raw() == actual_type.raw()); 1533 EXPECT(expected_type.raw() == actual_type.raw());
1531 } 1534 }
1532 { 1535 {
1533 Dart_Handle super_type = Dart_GetSupertype(Test5_int_type); 1536 Dart_Handle super_type = Dart_GetSupertype(Test5_int_type);
1534 const Type& expected_type = Api::UnwrapTypeHandle(isolate, Test4_int_type); 1537 const Type& expected_type = Api::UnwrapTypeHandle(isolate, Test4_int_type);
1535 const Type& actual_type = Api::UnwrapTypeHandle(isolate, super_type); 1538 const Type& actual_type = Api::UnwrapTypeHandle(isolate, super_type);
1536 EXPECT(expected_type.raw() == actual_type.raw()); 1539 EXPECT(expected_type.raw() == actual_type.raw());
1537 } 1540 }
1541 {
1542 Dart_Handle set_type = Dart_GetType(core_lib, set_name, 0, NULL);
1543 Dart_Handle super_type = Dart_GetSupertype(set_type);
1544 Dart_Handle iterable_type = Dart_GetType(core_lib, iterable_name, 0, NULL);
1545 const Type& expected_type = Api::UnwrapTypeHandle(isolate, iterable_type);
1546 const Type& actual_type = Api::UnwrapTypeHandle(isolate, super_type);
1547 EXPECT(expected_type.raw() == actual_type.raw());
1548 }
1538 } 1549 }
1539 1550
1540 } // namespace dart 1551 } // namespace dart
OLDNEW
« runtime/vm/debugger_api_impl.cc ('K') | « runtime/vm/debugger_api_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698