Disable Google Analytics in automated tests.

R=lukechurch@google.com

Review URL: https://codereview.chromium.org//532953003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39863 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
ahe@google.com 2014-09-04 12:11:47 +00:00
parent e4736148b1
commit e277fbb20b
2 changed files with 4 additions and 0 deletions

View file

@ -190,6 +190,8 @@ body /deep/ .hazed-suggestion:after {
<!-- Enable Google Analytics -->
<script type="text/javascript">
if (document.cookie.split(new RegExp('; *')).indexOf('org-trydart-AutomatedTest=true') == -1) {
window.parent && window.parent.postMessage('Enabling Analytics.', '*');
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-26406144-2']);
_gaq.push(['_trackPageview']);
@ -199,6 +201,7 @@ body /deep/ .hazed-suggestion:after {
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
}
</script>
</head>
<body>

View file

@ -69,6 +69,7 @@ void onIframeLoaded(Event event) {
}
void main() {
document.cookie = 'org-trydart-AutomatedTest=true;path=/';
asyncStart();
window.onMessage.listen((MessageEvent e) {
switch (e.data) {