Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(215)

Side by Side Diff: chrome/test/data/is_search_provider_installed.html

Issue 10091025: Convert the external extension ui_test to a browser_test. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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>
OLDNEW
« no previous file with comments | « chrome/renderer/external_extension_uitest.cc ('k') | chrome/test/data/is_search_provider_installed_with_exception.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698