| OLD | NEW |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../fast/js/resources/js-test-pre.js"></script> | 4 <script src="../fast/js/resources/js-test-pre.js"></script> |
| 5 </head> | 5 </head> |
| 6 <body> | 6 <body> |
| 7 <script type="text/javascript"> | 7 <script type="text/javascript"> |
| 8 shouldBeDefined("navigator.startActivity"); | 8 shouldBeDefined("navigator.webkitStartActivity"); |
| 9 | 9 |
| 10 shouldThrow("var intent = new Intent()", "'TypeError: Not enough arguments
'");; | 10 shouldThrow("var intent = new WebKitIntent()", "'TypeError: Not enough arg
uments'");; |
| 11 shouldThrow("new Intent('a')", "'TypeError: Not enough arguments'"); | 11 shouldThrow("new WebKitIntent('a')", "'TypeError: Not enough arguments'"); |
| 12 shouldThrow("new Intent('','','')", "'Error: SYNTAX_ERR: DOM Exception 12'
"); | 12 shouldThrow("new WebKitIntent('','','')", "'Error: SYNTAX_ERR: DOM Excepti
on 12'"); |
| 13 shouldThrow("new Intent('','b','c')", "'Error: SYNTAX_ERR: DOM Exception 1
2'"); | 13 shouldThrow("new WebKitIntent('','b','c')", "'Error: SYNTAX_ERR: DOM Excep
tion 12'"); |
| 14 shouldThrow("new Intent('','','c')", "'Error: SYNTAX_ERR: DOM Exception 12
'"); | 14 shouldThrow("new WebKitIntent('','','c')", "'Error: SYNTAX_ERR: DOM Except
ion 12'"); |
| 15 shouldThrow("new Intent('a','','c')", "'Error: SYNTAX_ERR: DOM Exception 1
2'"); | 15 shouldThrow("new WebKitIntent('a','','c')", "'Error: SYNTAX_ERR: DOM Excep
tion 12'"); |
| 16 | 16 |
| 17 var intent1 = new Intent('a', 'b'); | 17 var intent1 = new WebKitIntent('a', 'b'); |
| 18 shouldBeEqualToString("intent1.action", "a"); | 18 shouldBeEqualToString("intent1.action", "a"); |
| 19 shouldBeEqualToString("intent1.type", "b"); | 19 shouldBeEqualToString("intent1.type", "b"); |
| 20 shouldBeUndefined("intent1.data"); | 20 shouldBeUndefined("intent1.data"); |
| 21 intent1.action = "abc"; | 21 intent1.action = "abc"; |
| 22 shouldBeEqualToString("intent1.action", "a"); | 22 shouldBeEqualToString("intent1.action", "a"); |
| 23 | 23 |
| 24 var intent2 = new Intent("a", "b", "c"); | 24 var intent2 = new WebKitIntent("a", "b", "c"); |
| 25 shouldBeEqualToString('intent2.action', "a"); | 25 shouldBeEqualToString('intent2.action', "a"); |
| 26 shouldBeEqualToString('intent2.type', "b"); | 26 shouldBeEqualToString('intent2.type', "b"); |
| 27 shouldBeEqualToString('intent2.data', "c"); | 27 shouldBeEqualToString('intent2.data', "c"); |
| 28 | 28 |
| 29 var intent3 = new Intent("a", "b", {"c": "d"}); | 29 var intent3 = new WebKitIntent("a", "b", {"c": "d"}); |
| 30 shouldBeEqualToString('intent3.action', "a"); | 30 shouldBeEqualToString('intent3.action', "a"); |
| 31 shouldBeEqualToString('intent3.type', "b"); | 31 shouldBeEqualToString('intent3.type', "b"); |
| 32 shouldBeEqualToString('intent3.data.c', "d"); | 32 shouldBeEqualToString('intent3.data.c', "d"); |
| 33 | 33 |
| 34 var intent4 = new Intent("a", "b", ["c", "d"]); | 34 var intent4 = new WebKitIntent("a", "b", ["c", "d"]); |
| 35 shouldBeEqualToString('intent4.action', "a"); | 35 shouldBeEqualToString('intent4.action', "a"); |
| 36 shouldBeEqualToString('intent4.type', "b"); | 36 shouldBeEqualToString('intent4.type', "b"); |
| 37 shouldBeTrue('intent4.data instanceof Array'); | 37 shouldBeTrue('intent4.data instanceof Array'); |
| 38 shouldEvaluateTo('intent4.data.length', 2); | 38 shouldEvaluateTo('intent4.data.length', 2); |
| 39 shouldBeEqualToString('intent4.data[0]', "c"); | 39 shouldBeEqualToString('intent4.data[0]', "c"); |
| 40 shouldBeEqualToString('intent4.data[1]', "d"); | 40 shouldBeEqualToString('intent4.data[1]', "d"); |
| 41 | 41 |
| 42 var intent5 = new Intent("a", "b", 4); | 42 var intent5 = new WebKitIntent("a", "b", 4); |
| 43 shouldEvaluateTo('intent5.data', 4); | 43 shouldEvaluateTo('intent5.data', 4); |
| 44 var intent6 = new Intent('a', 'b', 4.5); | 44 var intent6 = new WebKitIntent('a', 'b', 4.5); |
| 45 shouldEvaluateTo('intent6.data', 4.5); | 45 shouldEvaluateTo('intent6.data', 4.5); |
| 46 var intent7 = new Intent('a', 'b', true); | 46 var intent7 = new WebKitIntent('a', 'b', true); |
| 47 shouldBeTrue('intent7.data'); | 47 shouldBeTrue('intent7.data'); |
| 48 var intent8 = new Intent('a', 'b', null); | 48 var intent8 = new WebKitIntent('a', 'b', null); |
| 49 shouldBeNull('intent8.data'); | 49 shouldBeNull('intent8.data'); |
| 50 var intent9 = new Intent('a', 'b', {}); | 50 var intent9 = new WebKitIntent('a', 'b', {}); |
| 51 shouldEvaluateTo('intent9.data', {}); | 51 shouldEvaluateTo('intent9.data', {}); |
| 52 | 52 |
| 53 shouldThrow('navigator.startActivity(intent1)', "'Error: INVALID_ACCESS_ER
R: DOM Exception 15'"); | 53 shouldThrow('navigator.webkitStartActivity(intent1)', "'Error: INVALID_ACC
ESS_ERR: DOM Exception 15'"); |
| 54 </script> | 54 </script> |
| 55 <script src="../fast/js/resources/js-test-post.js"></script> | 55 <script src="../fast/js/resources/js-test-post.js"></script> |
| 56 </body> | 56 </body> |
| 57 </html> | 57 </html> |
| OLD | NEW |