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

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

Issue 343086: Don't switch to CF's active document for frames or iframes.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome_frame/test/chrome_frame_unittests.cc ('k') | chrome_frame/test/data/full_tab_sub_frame1.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 30697)
+++ chrome_frame/test/data/chrome_frame_tester_helpers.js (working copy)
@@ -17,10 +17,10 @@
http = new XMLHttpRequest();
} catch(e) {
}
-
+
if (http)
return http;
-
+
for (var i = 0; i < 3; ++i) {
var progid = XMLHTTP_PROGIDS[i];
try {
@@ -140,11 +140,16 @@
window.location = redirect_location;
}
+function isRunningInChrome() {
+ var is_chrome = /chrome/.test(navigator.userAgent.toLowerCase());
+ return is_chrome;
+}
+
function TestIfRunningInChrome() {
- var is_chrome = /chrome/.test(navigator.userAgent.toLowerCase());
- if (!is_chrome) {
+ var is_chrome = isRunningInChrome();
+ if (!isRunningInChrome()) {
onFailure("ChromeFrameWindowOpen", "Window Open failed :-(",
- "User agent = " + navigator.userAgent.toLowerCase());
+ "User agent = " + navigator.userAgent.toLowerCase());
}
return is_chrome;
}
« no previous file with comments | « chrome_frame/test/chrome_frame_unittests.cc ('k') | chrome_frame/test/data/full_tab_sub_frame1.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698