4 <script src="../../http/tests/inspector/resources/inspector-test.js"></script>
8 class TestCollection extends WI.Collection {
9 objectIsRequiredType(object)
15 class StringCollection extends WI.Collection {
16 objectIsRequiredType(object)
18 return typeof object === "string";
22 let suite = InspectorTest.createSyncSuite("Collection");
25 name: "WI.Collection.prototype.add",
27 let collection = new TestCollection;
28 collection.add("one");
29 collection.add("two");
31 InspectorTest.log(collection);
35 InspectorTest.log(collection);
42 name: "WI.Collection.prototype.remove",
46 let collection = new TestCollection;
48 collection.add("two");
50 InspectorTest.log(collection);
52 collection.remove(item);
54 InspectorTest.log(collection);
61 name: "WI.Collection.prototype.clear",
63 let collection = new TestCollection;
64 collection.add("one");
65 collection.add("two");
68 InspectorTest.log(collection);
72 InspectorTest.log(collection);
79 name: "WI.Collection.SpecifiedType",
81 let collection = new StringCollection;
82 collection.add("one");
83 collection.add("two");
85 InspectorTest.log(collection);
89 InspectorTest.log(collection);
95 suite.runTestCasesAndFinish();
99 <body onload="runTest()">
100 <p>Testing all methods of Collection.</p>