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

Side by Side Diff: chrome/test/data/is_search_provider_installed_with_exception.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
« no previous file with comments | « chrome/test/data/is_search_provider_installed.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>";
11 } 11 }
12 12
13 function logPassed(message) { 13 function logPassed(message) {
14 log("PASS: " + message); 14 log("PASS: " + message);
15 } 15 }
16 16
17 function logFailed(message) { 17 function logFailed(message) {
18 passedAll = false; 18 passedAll = false;
19 log("FAIL: " + message); 19 log("FAIL: " + message);
20 } 20 }
21 21
22 function writeResult() { 22 function writeResult() {
23 var result = "1"; 23 if (passedAll) {
24 if (passedAll)
25 logPassed("Everything passed."); 24 logPassed("Everything passed.");
26 else { 25 document.title = "OK";
26 } else {
27 logFailed("At least one test failed."); 27 logFailed("At least one test failed.");
28 result = " " + document.body.innerText; // Add a space to ensure that the 28 document.title = "FAIL";
29 » » » » » // result doesn't resemble success.
30 } 29 }
31 document.cookie = document.location.hostname + "testResult=" + escape(result);
32 } 30 }
33 31
34 function MyObject() { 32 function MyObject() {
35 } 33 }
36 34
37 try { 35 try {
38 MyObject.prototype.toString = function() { throw "test"; } 36 MyObject.prototype.toString = function() { throw "test"; }
39 var object = new MyObject(); 37 var object = new MyObject();
40 38
41 // Verify the search provider state for the current page. 39 // Verify the search provider state for the current page.
42 var installed = window.external.IsSearchProviderInstalled(object) 40 var installed = window.external.IsSearchProviderInstalled(object)
43 writeResult(); 41 writeResult();
44 } catch (e) { 42 } catch (e) {
45 logFailed("An exception occurred. Name: " + e.name + " Message: " + 43 logFailed("An exception occurred. Name: " + e.name + " Message: " +
46 e.message); 44 e.message);
47 writeResult(); 45 writeResult();
48 } 46 }
49 </script> 47 </script>
50 </body> 48 </body>
51 </html> 49 </html>
OLDNEW
« no previous file with comments | « chrome/test/data/is_search_provider_installed.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698