| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="/resources/testharness.js"></script> | 4 <script src="/resources/testharness.js"></script> |
| 5 <script src="/resources/testharnessreport.js"></script> | 5 <script src="/resources/testharnessreport.js"></script> |
| 6 <script src="support/test_utils.js"></script> | 6 <script src="support/test_utils.js"></script> |
| 7 </head> | 7 </head> |
| 8 | 8 |
| 9 <body> | 9 <body> |
| 10 <script> | 10 <script> |
| 11 /** Ensures that all datatypes are nonempty. */ | 11 /** Ensures that all datatypes are nonempty. */ |
| 12 function populateDatatypes() { | 12 function populateDatatypes() { |
| 13 return Promise.all(TestUtils.DATATYPES.map(function(datatype) { | 13 return Promise.all(TestUtils.DATATYPES.map(function(datatype) { |
| 14 return datatype.add().then(datatype.isEmpty().then(function(isEmpty) { | 14 return new Promise(function(resolve, reject) { |
| 15 assert_false( | 15 datatype.add().then(function() { |
| 16 isEmpty, | 16 datatype.isEmpty().then(function(isEmpty) { |
| 17 datatype.name + " has to be nonempty before the test starts."); | 17 assert_false( |
| 18 })); | 18 isEmpty, |
| 19 datatype.name + |
| 20 " has to be nonempty before the test starts."); |
| 21 resolve(); |
| 22 }); |
| 23 }); |
| 24 }); |
| 19 })); | 25 })); |
| 20 } | 26 } |
| 21 | 27 |
| 22 /** | 28 /** |
| 23 * @param Array.<Array.<Datatype>> combination A combination of datatypes. | 29 * @param Array.<Array.<Datatype>> combination A combination of datatypes. |
| 24 * @param Dict.<string, boolean> report A map between a datatype name and | 30 * @param Dict.<string, boolean> report A map between a datatype name and |
| 25 * whether it is empty. | 31 * whether it is empty. |
| 26 * @return boolean Whether all datatypes are empty if and only if they are | 32 * @return boolean Whether all datatypes are empty if and only if they are |
| 27 * included in the |combination|. | 33 * included in the |combination|. |
| 28 */ | 34 */ |
| (...skipping 28 matching lines...) Expand all Loading... |
| 57 document.body.appendChild(iframe); | 63 document.body.appendChild(iframe); |
| 58 }).then(function(messageEvent) { | 64 }).then(function(messageEvent) { |
| 59 verifyDatatypes(combination, messageEvent.data); | 65 verifyDatatypes(combination, messageEvent.data); |
| 60 }); | 66 }); |
| 61 }); | 67 }); |
| 62 }, test_name); | 68 }, test_name); |
| 63 }); | 69 }); |
| 64 </script> | 70 </script> |
| 65 </body> | 71 </body> |
| 66 </html> | 72 </html> |
| OLD | NEW |