Chromium Code Reviews

Unified Diff: chrome_frame/test/data/chrome_frame_tester_helpers.js

Issue 340029: Added unit tests for ChromeFrame IE full tab mode. These test the following c... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « chrome_frame/test/chrome_frame_unittests.cc ('k') | chrome_frame/test/data/chrome_frame_window_open.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/test/data/chrome_frame_tester_helpers.js
===================================================================
--- chrome_frame/test/data/chrome_frame_tester_helpers.js (revision 30411)
+++ chrome_frame/test/data/chrome_frame_tester_helpers.js (working copy)
@@ -13,8 +13,8 @@
var XMLHTTP_PROGIDS = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP',
'Msxml2.XMLHTTP.4.0'];
var http = null;
- try {
- http = new XMLHttpRequest();
+ try {
+ http = new XMLHttpRequest();
} catch(e) {
}
@@ -26,11 +26,11 @@
try {
http = new ActiveXObject(progid);
} catch(e) {
- }
-
- if (http)
- break;
}
+
+ if (http)
+ break;
+ }
return http;
}
@@ -69,7 +69,7 @@
appendStatus("XHR send failed. Error: " + e.description);
}
}
-
+
function postResult(name, result) {
writeToServer(name, result);
// NOTE:
@@ -77,7 +77,7 @@
shutdownServer();
}
-// Finish running a test by setting the status
+// Finish running a test by setting the status
// and the cookie.
function onFinished(name, id, result) {
appendStatus(result);
@@ -85,7 +85,7 @@
// set a cookie to report the results...
var cookie = name + "." + id + ".status=" + result + "; path=/";
document.cookie = cookie;
-
+
// ...and POST the status back to the server
postResult(name, result);
}
@@ -140,3 +140,11 @@
window.location = redirect_location;
}
+function TestIfRunningInChrome() {
+ var is_chrome = /chrome/.test(navigator.userAgent.toLowerCase());
+ if (!is_chrome) {
+ onFailure("ChromeFrameWindowOpen", "Window Open failed :-(",
+ "User agent = " + navigator.userAgent.toLowerCase());
+ }
+ return is_chrome;
+}
Property changes on: chrome_frame\test\data\chrome_frame_tester_helpers.js
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome_frame/test/chrome_frame_unittests.cc ('k') | chrome_frame/test/data/chrome_frame_window_open.html » ('j') | no next file with comments »

Powered by Google App Engine