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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // 1 //
2 // This script provides some mechanics for testing ChromeFrame 2 // This script provides some mechanics for testing ChromeFrame
3 // 3 //
4 function onSuccess(name, id) { 4 function onSuccess(name, id) {
5 onFinished(name, id, "OK"); 5 onFinished(name, id, "OK");
6 } 6 }
7 7
8 function onFailure(name, id, status) { 8 function onFailure(name, id, status) {
9 onFinished(name, id, status); 9 onFinished(name, id, status);
10 } 10 }
11 11
12 function getXHRObject(){ 12 function getXHRObject(){
13 var XMLHTTP_PROGIDS = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 13 var XMLHTTP_PROGIDS = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP',
14 'Msxml2.XMLHTTP.4.0']; 14 'Msxml2.XMLHTTP.4.0'];
15 var http = null; 15 var http = null;
16 try { 16 try {
17 http = new XMLHttpRequest(); 17 http = new XMLHttpRequest();
18 } catch(e) { 18 } catch(e) {
19 } 19 }
20 20
21 if (http) 21 if (http)
22 return http; 22 return http;
23 23
24 for (var i = 0; i < 3; ++i) { 24 for (var i = 0; i < 3; ++i) {
25 var progid = XMLHTTP_PROGIDS[i]; 25 var progid = XMLHTTP_PROGIDS[i];
26 try { 26 try {
27 http = new ActiveXObject(progid); 27 http = new ActiveXObject(progid);
28 } catch(e) { 28 } catch(e) {
29 } 29 }
30 30
31 if (http) 31 if (http)
32 break; 32 break;
33 } 33 }
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 133
134 return false; 134 return false;
135 } 135 }
136 136
137 function reloadUsingCFProtocol() { 137 function reloadUsingCFProtocol() {
138 var redirect_location = "cf:"; 138 var redirect_location = "cf:";
139 redirect_location += window.location; 139 redirect_location += window.location;
140 window.location = redirect_location; 140 window.location = redirect_location;
141 } 141 }
142 142
143 function isRunningInChrome() {
144 var is_chrome = /chrome/.test(navigator.userAgent.toLowerCase());
145 return is_chrome;
146 }
147
143 function TestIfRunningInChrome() { 148 function TestIfRunningInChrome() {
144 var is_chrome = /chrome/.test(navigator.userAgent.toLowerCase()); 149 var is_chrome = isRunningInChrome();
145 if (!is_chrome) { 150 if (!isRunningInChrome()) {
146 onFailure("ChromeFrameWindowOpen", "Window Open failed :-(", 151 onFailure("ChromeFrameWindowOpen", "Window Open failed :-(",
147 "User agent = " + navigator.userAgent.toLowerCase()); 152 "User agent = " + navigator.userAgent.toLowerCase());
148 } 153 }
149 return is_chrome; 154 return is_chrome;
150 } 155 }
OLDNEW
« 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