forked from ampproject/amphtml
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix various issues with the inabox integration tests (ampproject#20972)
* Fix various issues with the inabox integration tests. * Try referencing window directly * Load safeframe from the Karma test server. * Disable the problematic tests to verify the rest works * Skip safe frame tests on Firefox * lint * Properly test inabox-viewport-friendly flag. Notably this allows Safari to pass the friendly frame case without needing the host script * lint * Trivial comment * Relax the min percentage visible restriction. On Firefox occasionally the window may not scroll down all the way, barely missing out on the 50% mark.
- Loading branch information
1 parent
ca9fc10
commit 09af523
Showing
5 changed files
with
78 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<!-- saved from url=(0069)http://tpc.googlesyndication.com/safeframe/1-0-32/html/container.html --> | ||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
|
||
<title>SafeFrame Container</title> | ||
<script> | ||
(function(){var aa="function"==typeof Object.create?Object.create:function(a){var b=function(){};b.prototype=a;return new b},l;if("function"==typeof Object.setPrototypeOf)l=Object.setPrototypeOf;else{var n;a:{var ba={h:!0},q={};try{q.__proto__=ba;n=q.h;break a}catch(a){}n=!1}l=n?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var r=l,t=this;var v=String.prototype.trim?function(a){return a.trim()}:function(a){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(a)[1]},w=function(a,b){return a<b?-1:a>b?1:0};var x;a:{var y=t.navigator;if(y){var z=y.userAgent;if(z){x=z;break a}}x=""};var B=function(a){B[" "](a);return a};B[" "]=function(){};var da=function(a,b){var c=ca;return Object.prototype.hasOwnProperty.call(c,a)?c[a]:c[a]=b(a)};var ea=-1!=x.indexOf("Opera"),C=-1!=x.indexOf("Trident")||-1!=x.indexOf("MSIE"),D=-1!=x.indexOf("Edge"),E=-1!=x.indexOf("Gecko")&&!(-1!=x.toLowerCase().indexOf("webkit")&&-1==x.indexOf("Edge"))&&!(-1!=x.indexOf("Trident")||-1!=x.indexOf("MSIE"))&&-1==x.indexOf("Edge"),F=-1!=x.toLowerCase().indexOf("webkit")&&-1==x.indexOf("Edge"),G;a:{var H="",I=function(){var a=x;if(E)return/rv:([^\);]+)(\)|;)/.exec(a);if(D)return/Edge\/([\d\.]+)/.exec(a);if(C)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(F)return/WebKit\/(\S+)/.exec(a);if(ea)return/(?:Version)[ \/]?(\S+)/.exec(a)}();I&&(H=I?I[1]:"");if(C){var K,M=t.document;K=M?M.documentMode:void 0;if(null!=K&&K>parseFloat(H)){G=String(K);break a}}G=H}var fa=G,ca={},N=function(a){return da(a,function(){for(var b=0,c=v(String(fa)).split("."),e=v(String(a)).split("."),d=Math.max(c.length,e.length),f=0;0==b&&f<d;f++){var h=c[f]||"",g=e[f]||"";do{h=/(\d*)(\D*)(.*)/.exec(h)||["","","",""];g=/(\d*)(\D*)(.*)/.exec(g)||["","","",""];if(0==h[0].length&&0==g[0].length)break;b=w(0==h[1].length?0:parseInt(h[1],10),0==g[1].length?0:parseInt(g[1],10))||w(0==h[2].length,0==g[2].length)||w(h[2],g[2]);h=h[3];g=g[3]}while(0==b)}return 0<=b})};var O=null,P=null,ia=function(a){var b=a.length,c=0;"="===a[b-2]?c=2:"="===a[b-1]&&(c=1);var e=new Uint8Array(Math.ceil(3*b/4)-c),d=0;ha(a,function(a){e[d++]=a});return e.subarray(0,d)},ha=function(a,b){function c(b){for(;e<a.length;){var c=a.charAt(e++),f=P[c];if(null!=f)return f;if(!/^[\s\xa0]*$/.test(c))throw Error("Unknown base64 encoding at char: "+c);}return b}ja();for(var e=0;;){var d=c(-1),f=c(0),h=c(64),g=c(64);if(64===g&&-1===d)break;b(d<<2|f>>4);64!=h&&(b(f<<4&240|h>>2),64!=g&&b(h<<6&192|g))}},ja=function(){if(!O){O={};P={};for(var a=0;65>a;a++)O[a]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(a),P[O[a]]=a,62<=a&&(P["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.".charAt(a)]=a)}};var Q=function(a,b){if(a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.call(void 0,a[c],c,a)};var R=function(a,b,c){c=void 0===c?{}:c;this.error=a;this.context=b.context;this.line=b.line||-1;this.msg=b.message||"";this.file=b.file||"";this.id=b.id||"jserror";this.meta=c};var ka=/^https?:\/\/(\w|-)+\.cdn\.ampproject\.(net|org)(\?|\/|$)/,la=function(a,b){this.a=a;this.b=b},S=function(a,b){this.url=a;this.g=!!b;this.depth=null};var ma=function(a){t.google_image_requests||(t.google_image_requests=[]);var b=t.document.createElement("img");b.src=a;t.google_image_requests.push(b)};var T=function(){this.c="&";this.f=!1;this.b={};this.j=0;this.a=[]},U=function(a,b){var c={};c[a]=b;return[c]},W=function(a,b,c,e,d){var f=[];Q(a,function(a,g){(a=V(a,b,c,e,d))&&f.push(g+"="+a)});return f.join(b)},V=function(a,b,c,e,d){if(null==a)return"";b=b||"&";c=c||",$";"string"==typeof c&&(c=c.split(""));if(a instanceof Array){if(e=e||0,e<c.length){for(var f=[],h=0;h<a.length;h++)f.push(V(a[h],b,c,e+1,d));return f.join(c[e])}}else if("object"==typeof a)return d=d||0,2>d?encodeURIComponent(W(a,b,c,e,d+1)):"...";return encodeURIComponent(String(a))},X=function(a,b,c,e){a.a.push(b);a.b[b]=U(c,e)},oa=function(a){var b="https://pagead2.googlesyndication.com/pagead/gen_204?id=jserror&",c=na(a)-27;if(0>c)return"";a.a.sort(function(a,b){return a-b});for(var e=null,d="",f=0;f<a.a.length;f++)for(var h=a.a[f],g=a.b[h],m=0;m<g.length;m++){if(!c){e=null==e?h:e;break}var k=W(g[m],a.c,",$");if(k){k=d+k;if(c>=k.length){c-=k.length;b+=k;d=a.c;break}else a.f&&(d=c,k[d-1]==a.c&&--d,b+=k.substr(0,d),d=a.c,c=0);e=null==e?h:e}}a="";null!=e&&(a=d+"trn="+e);return b+a+""},na=function(a){var b=1,c;for(c in a.b)b=c.length>b?c.length:b;return 3997-b-a.c.length-1};var pa=function(a){if(.01>Math.random())try{if(a instanceof T)var b=a;else b=new T,Q(a,function(a,c){var f=b,e=f.j++;a=U(c,a);f.a.push(e);f.b[e]=a});var c=oa(b);c&&ma(c)}catch(e){}};var sa=function(a){try{var b=new T;b.f=!0;X(b,1,"context",507);if(!(a.error&&a.meta&&a.id)){var c=a;a=new qa(ra(c),c.fileName,c.lineNumber)}a.msg&&X(b,2,"msg",a.msg.substring(0,512));a.file&&X(b,3,"file",a.file);0<a.line&&X(b,4,"line",a.line);var e=[a.meta||{}];b.a.push(5);b.b[5]=e;c=t;a=[];e=null;do{var d=c;try{var f;if(f=!!d&&null!=d.location.href)b:{try{B(d.foo);f=!0;break b}catch(A){}f=!1}var h=f}catch(A){h=!1}if(h){var g=d.location.href;e=d.document&&d.document.referrer||null}else g=e,e=null;a.push(new S(g||""));try{c=d.parent}catch(A){c=null}}while(c&&d!=c);g=0;for(var m=a.length-1;g<=m;++g)a[g].depth=m-g;d=t;if(d.location&&d.location.ancestorOrigins&&d.location.ancestorOrigins.length==a.length-1)for(m=1;m<a.length;++m){var k=a[m];k.url||(k.url=d.location.ancestorOrigins[m-1]||"",k.g=!0)}var J=new S(t.location.href,!1);d=null;var L=a.length-1;for(k=L;0<=k;--k){var p=a[k];!d&&ka.test(p.url)&&(d=p);if(p.url&&!p.g){J=p;break}}p=null;var va=a.length&&a[L].url;0!=J.depth&&va&&(p=a[L]);var u=new la(J,p);u.b&&X(b,6,"top",u.b.url||"");X(b,7,"url",u.a.url||"");pa(b)}catch(A){try{pa({context:"ecmserr",rctx:507,msg:ra(A),url:u&&u.a.url})}catch(za){}}},ra=function(a){var b=a.toString();a.name&&-1==b.indexOf(a.name)&&(b+=": "+a.name);a.message&&-1==b.indexOf(a.message)&&(b+=": "+a.message);if(a.stack){a=a.stack;var c=b;try{-1==a.indexOf(c)&&(a=c+"\n"+a);for(var e;a!=e;)e=a,a=a.replace(/((https?:\/..*\/)[^\/:]*:\d+(?:.|\n)*)\2/,"$1");b=a.replace(/\n */g,"\n")}catch(d){b=c}}return b},qa=function(a,b,c){R.call(this,Error(a),{message:a,file:void 0===b?"":b,line:void 0===c?-1:c})},Y=qa;Y.prototype=aa(R.prototype);Y.prototype.constructor=Y;if(r)r(Y,R);else for(var Z in R)if("prototype"!=Z)if(Object.defineProperties){var ta=Object.getOwnPropertyDescriptor(R,Z);ta&&Object.defineProperty(Y,Z,ta)}else Y[Z]=R[Z];Y.m=R.prototype;var ua=E||F||C&&N(11)||D;var wa=/^([^;]+);(\d+);([\s\S]*)$/,xa=function(){var a=wa.exec(window.name);if(null===a)throw Error("Cannot parse serialized data");var b=+a[2],c=a[3];if(b>c.length)throw Error("Cannot parse serialized data");return{l:a[1],content:c.substr(0,b),i:c.substr(b)}};var ya=function(){var a=window.location.hash;return a?(a=a.match(/[&#]eid=([\d,]+)/))?a[1].split(","):[]:[]};(function(a){try{var b=xa(),c=ya(),e=JSON.parse(b.i),d=e.encryptionMode;a(b.content,void 0===d?null:d,function(a){ua&&(window.name="");e.goog_safeframe_hlt&&(t.goog_safeframe_hlt=e.goog_safeframe_hlt);e._context&&(t.AMP_CONTEXT_DATA=e._context);t.sf_={v:b.l,exp:c,cfg:e};var d=window;if(ua)d=d.document,d.open("text/html","replace"),d.write(a),d.close();else{var g;if(g=C&&N(7)&&!N(10))g=navigator.userAgent.match(/Trident\/([0-9]+.[0-9]+)/),g=6>(g?parseFloat(g[1]):0);if(g)a:{for(g=0;g<a.length;++g)if(127<a.charCodeAt(g)){g=!0;break a}g=!1}if(g){a=unescape(encodeURIComponent(a));g=Math.floor(a.length/2);for(var f=[],k=0;k<g;++k)f[k]=String.fromCharCode(256*a.charCodeAt(2*k+1)+a.charCodeAt(2*k));1==a.length%2&&(f[g]=a.charAt(a.length-1));a=f.join("")}d.goog_content=a;d.location.replace("javascript:window.goog_content")}},function(a){sa(a)})}catch(f){sa(f)}})(function(a,b,c){if(2===b){a=ia(a);b=[];for(var e=0,d=0;e<a.length;){var f=a[e++];if(128>f)b[d++]=String.fromCharCode(f);else if(191<f&&224>f){var h=a[e++];b[d++]=String.fromCharCode((f&31)<<6|h&63)}else if(239<f&&365>f){h=a[e++];var g=a[e++],m=a[e++];f=((f&7)<<18|(h&63)<<12|(g&63)<<6|m&63)-65536;b[d++]=String.fromCharCode(55296+(f>>10));b[d++]=String.fromCharCode(56320+(f&1023))}else h=a[e++],g=a[e++],b[d++]=String.fromCharCode((f&15)<<12|(h&63)<<6|g&63)}a=b.join("");a&&(b=a.toLowerCase(),a=-1<b.indexOf("<!doctype")||-1<b.indexOf("<html")?a:"<html><head></head><body>"+a+"</body></html>")}c(a)});}).call(this); | ||
</script> | ||
</head> | ||
<body> | ||
|
||
|
||
</body></html> |
Oops, something went wrong.