OLD | NEW |
1 <html> | 1 <html> |
2 <body> | 2 <body> |
3 <p>Test IsProviderInstalled.<p> | 3 <p>Test IsProviderInstalled.<p> |
4 <div id=result> | 4 <div id=result> |
5 </div> | 5 </div> |
6 <script> | 6 <script> |
7 var passedAll = true; | 7 var passedAll = true; |
8 | 8 |
9 function log(message) { | 9 function log(message) { |
10 document.getElementById("result").innerHTML += message + "<br>"; | 10 document.getElementById("result").innerHTML += message + "<br>"; |
(...skipping 12 matching lines...) Expand all Loading... |
23 try { | 23 try { |
24 window.external.IsSearchProviderInstalled(origin); | 24 window.external.IsSearchProviderInstalled(origin); |
25 logFailed("No exception for a " + testName + " (" + origin + ")."); | 25 logFailed("No exception for a " + testName + " (" + origin + ")."); |
26 } catch (e) { | 26 } catch (e) { |
27 logPassed("Got an exception for a " + testName + " (" + origin + ")."); | 27 logPassed("Got an exception for a " + testName + " (" + origin + ")."); |
28 } | 28 } |
29 } | 29 } |
30 | 30 |
31 function writeResult() { | 31 function writeResult() { |
32 var result = "1"; | 32 var result = "1"; |
33 if (passedAll) | 33 if (passedAll) { |
34 logPassed("Everything passed."); | 34 logPassed("Everything passed."); |
35 else { | 35 document.title = "OK"; |
| 36 } else { |
36 logFailed("At least one test failed."); | 37 logFailed("At least one test failed."); |
37 result = " " + document.body.innerText; // Add a space to ensure that the | 38 document.title = "FAIL" |
38 » » » » » // result doesn't resemble success. | |
39 } | 39 } |
40 document.cookie = document.location.hostname + "testResult=" + escape(result); | |
41 } | 40 } |
42 | 41 |
43 try { | 42 try { |
44 var differentProtocol = | 43 var differentProtocol = |
45 document.location.protocol == "http:" ? "https:" : "http:"; | 44 document.location.protocol == "http:" ? "https:" : "http:"; |
46 var differentPort = | 45 var differentPort = |
47 (!document.location.port || document.location.port == "80") ? ":81" : ":80
"; | 46 (!document.location.port || document.location.port == "80") ? ":81" : ":80
"; |
48 | 47 |
49 var origin = document.location.protocol + "//" + document.location.host + "/"; | 48 var origin = document.location.protocol + "//" + document.location.host + "/"; |
50 var originWithDifferentProtocol = differentProtocol + "//" + | 49 var originWithDifferentProtocol = differentProtocol + "//" + |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 82 |
84 writeResult(); | 83 writeResult(); |
85 } catch (e) { | 84 } catch (e) { |
86 logFailed("An exception occurred. Name: " + e.name + " Message: " + | 85 logFailed("An exception occurred. Name: " + e.name + " Message: " + |
87 e.message); | 86 e.message); |
88 writeResult(); | 87 writeResult(); |
89 } | 88 } |
90 </script> | 89 </script> |
91 </body> | 90 </body> |
92 </html> | 91 </html> |
OLD | NEW |