| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <!-- Originally developed by Aryeh Gregor, funded by Google. Copyright belongs | 2 <!-- Originally developed by Aryeh Gregor, funded by Google. Copyright belongs |
| 3 to Google. --> | 3 to Google. --> |
| 4 <title>atob()/btoa() tests</title> | 4 <title>atob()/btoa() tests</title> |
| 5 <meta charset=utf-8> | 5 <meta charset=utf-8> |
| 6 <div id=log></div> | 6 <div id=log></div> |
| 7 <script src=../../../../../resources/testharness.js></script> | 7 <script src=/resources/testharness.js></script> |
| 8 <script src=../../../../../resources/testharnessreport.js></script> | 8 <script src=/resources/testharnessreport.js></script> |
| 9 <script> | 9 <script> |
| 10 /** | 10 /** |
| 11 * btoa() as defined by the HTML5 spec, which mostly just references RFC4648. | 11 * btoa() as defined by the HTML5 spec, which mostly just references RFC4648. |
| 12 */ | 12 */ |
| 13 function mybtoa(s) { | 13 function mybtoa(s) { |
| 14 // String conversion as required by WebIDL. | 14 // String conversion as required by WebIDL. |
| 15 s = String(s); | 15 s = String(s); |
| 16 | 16 |
| 17 // "The btoa() method must throw an INVALID_CHARACTER_ERR exception if the | 17 // "The btoa() method must throw an INVALID_CHARACTER_ERR exception if the |
| 18 // method's first argument contains any character whose code point is | 18 // method's first argument contains any character whose code point is |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 function(elem) { | 297 function(elem) { |
| 298 if (myatob(elem) === null) { | 298 if (myatob(elem) === null) { |
| 299 return ["atob(" + format_value(elem) + ") must raise InvalidCharacte
rError", elem]; | 299 return ["atob(" + format_value(elem) + ") must raise InvalidCharacte
rError", elem]; |
| 300 } | 300 } |
| 301 return ["atob(" + format_value(elem) + ") == " + format_value(myatob(ele
m)), elem]; | 301 return ["atob(" + format_value(elem) + ") == " + format_value(myatob(ele
m)), elem]; |
| 302 } | 302 } |
| 303 ); | 303 ); |
| 304 | 304 |
| 305 generate_tests(testAtob, tests); | 305 generate_tests(testAtob, tests); |
| 306 </script> | 306 </script> |
| OLD | NEW |