~chromium-team/chromium-browser/artful-beta

« back to all changes in this revision

Viewing changes to debian/tests/data/HTML5test/qr.html

  • Committer: Chad MILLER
  • Date: 2015-03-27 00:56:55 UTC
  • Revision ID: chad.miller@canonical.com-20150327005655-j4hcr8bscbjjjjyu
Prepare for snappy building.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE html>
2
 
 
3
 
<html>
4
 
        <head>
5
 
                <title>HTML5test - How well does your browser support HTML5?</title>
6
 
 
7
 
                <meta charset="UTF-8">
8
 
                <meta http-equiv="X-UA-Compatible" content="IE=EDGE">
9
 
 
10
 
                <meta name="viewport" content="width=device-width, initial-scale=1.0">
11
 
 
12
 
                <style type="text/css">
13
 
 
14
 
html {
15
 
        font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", "Helvetica", "Arial", "Lucida Grande", sans-serif;
16
 
        font-weight: 200;
17
 
        font-size: 1em;
18
 
}
19
 
 
20
 
body {
21
 
        background: #d9d9d9;
22
 
        text-align: center;
23
 
        margin: 20px;
24
 
}
25
 
 
26
 
p {
27
 
        margin: 0 0 0.5em;
28
 
}
29
 
a {
30
 
        color: #0092bf;
31
 
        text-decoration: none;
32
 
}
33
 
code {
34
 
        font-size: 1.2em;
35
 
}
36
 
 
37
 
                </style>
38
 
 
39
 
                <script src='/scripts/base.js' type='text/javascript'></script>
40
 
                <script src='/scripts/8/engine.js' type='text/javascript'></script>
41
 
                <script src='/scripts/8/data.js' type='text/javascript'></script>
42
 
 
43
 
                <script>
44
 
                        (function(){var p=[],w=window,d=document,e=f=0;p.push('ua='+encodeURIComponent(navigator.userAgent));e|=w.ActiveXObject?1:0;e|=w.opera?2:0;e|=w.chrome?4:0;
45
 
                        e|='getBoxObjectFor' in d || 'mozInnerScreenX' in w?8:0;e|=('WebKitCSSMatrix' in w||'WebKitPoint' in w||'webkitStorageInfo' in w||'webkitURL' in w)?16:0;
46
 
                        e|=(e&16&&({}.toString).toString().indexOf("\n")===-1)?32:0;p.push('e='+e);f|='sandbox' in d.createElement('iframe')?1:0;f|='WebSocket' in w?2:0;
47
 
                        f|=w.Worker?4:0;f|=w.applicationCache?8:0;f|=w.history && history.pushState?16:0;f|=d.documentElement.webkitRequestFullScreen?32:0;f|='FileReader' in w?64:0;
48
 
                        p.push('f='+f);p.push('r='+Math.random().toString(36).substring(7));p.push('w='+screen.width);p.push('h='+screen.height);var s=d.createElement('script');
49
 
                        s.src='//api.whichbrowser.net/rel/detect.js?' + p.join('&');d.getElementsByTagName('head')[0].appendChild(s);})();
50
 
                </script>
51
 
        </head>
52
 
 
53
 
 
54
 
        <body>
55
 
                <div id="qr"></div>
56
 
                <script>
57
 
                <!--
58
 
 
59
 
 
60
 
                        function waitForWhichBrowser(cb) {
61
 
                                var callback = cb;
62
 
 
63
 
                                function wait() {
64
 
                                        if (typeof WhichBrowser == 'undefined')
65
 
                                                window.setTimeout(wait, 100)
66
 
                                        else
67
 
                                                callback();
68
 
                                }
69
 
 
70
 
                                wait();
71
 
                        }
72
 
 
73
 
                        waitForWhichBrowser(function() {
74
 
 
75
 
                                Browsers = new WhichBrowser({
76
 
                                        useFeatures:            true,
77
 
                                        detectCamouflage:       true
78
 
                                });
79
 
 
80
 
                                start();
81
 
                        });
82
 
 
83
 
                        function start() {
84
 
                                var params = {};
85
 
 
86
 
                                if (location.search) {
87
 
                                        var parts = location.search.substring(1).split('&');
88
 
 
89
 
                                        for (var i = 0; i < parts.length; i++) {
90
 
                                                var nv = parts[i].split('=');
91
 
                                                if (!nv[0]) continue;
92
 
                                                params[nv[0]] = nv[1] || true;
93
 
                                        }
94
 
                                }
95
 
 
96
 
                                var identifier = typeof params.identifier != 'undefined' ? params.identifier : null;
97
 
                                var source = typeof params.source != 'undefined' ? params.source : null;
98
 
                                var task = typeof params.task != 'undefined' ? params.task : null;
99
 
 
100
 
 
101
 
                                new Test(function(r) {
102
 
                                        var c = new Calculate(r, tests);
103
 
 
104
 
                                        document.getElementById('qr').innerHTML +=
105
 
                                                "<p>You can see the results here:</p>" +
106
 
                                                "<p><a href='http://html5te.st/" + r.uniqueid + "'>html5te.st/" + r.uniqueid + "</a></p>" +
107
 
                                                "<p>Or scan this QR-code:</p>" +
108
 
                                                "<p>" +
109
 
                                                "<img src='https://chart.googleapis.com/chart?chs=200x200&cht=qr&chl=" + encodeURIComponent("http://html5te.st/" + r.uniqueid) + "&choe=UTF-8' width='200' height='200'>" +
110
 
                                                "</p>" +
111
 
                                                "<p>The unique id for this test is:<br><code>" + r.uniqueid + "</code></p>";
112
 
 
113
 
 
114
 
                                        var payload = '{' +
115
 
                                                                        '"release": "' + r.release + '",' +
116
 
                                                                        '"source": "' + source + '",' +
117
 
                                                                        '"identifier": "' + identifier + '",' +
118
 
                                                                        '"task": "' + task + '",' +
119
 
                                                                        '"uniqueid": "' + r.uniqueid + '",' +
120
 
                                                                        '"score": ' + c.score + ',' +
121
 
                                                                        '"maximum": ' + c.maximum + ',' +
122
 
                                                                        '"camouflage": "' + (Browsers.camouflage ? '1' : '0') + '",' +
123
 
                                                                        '"features": "' + (Browsers.features.join(',')) + '",' +
124
 
                                                                        '"browserName": "' + (Browsers.browser.name ? Browsers.browser.name : '') + '",' +
125
 
                                                                        '"browserChannel": "' + (Browsers.browser.channel ? Browsers.browser.channel : '') + '",' +
126
 
                                                                        '"browserVersion": "' + (Browsers.browser.version ? Browsers.browser.version.toString() : '') + '",' +
127
 
                                                                        '"browserVersionType": "' + (Browsers.browser.version ? Browsers.browser.version.type : '') + '",' +
128
 
                                                                        '"browserVersionMajor": "' + (Browsers.browser.version ? Browsers.browser.version.major : '') + '",' +
129
 
                                                                        '"browserVersionMinor": "' + (Browsers.browser.version ? Browsers.browser.version.minor : '') + '",' +
130
 
                                                                        '"browserVersionOriginal": "' + (Browsers.browser.version ? Browsers.browser.version.original : '') + '",' +
131
 
                                                                        '"browserMode": "' + (Browsers.browser.mode ? Browsers.browser.mode : '') + '",' +
132
 
                                                                        '"engineName": "' + (Browsers.engine.name ? Browsers.engine.name : '') + '",' +
133
 
                                                                        '"engineVersion": "' + (Browsers.engine.version ? Browsers.engine.version.toString() : '') + '",' +
134
 
                                                                        '"osName": "' + (Browsers.os.name ? Browsers.os.name : '') + '",' +
135
 
                                                                        '"osFamily": "' + (Browsers.os.family ? Browsers.os.family : '') + '",' +
136
 
                                                                        '"osVersion": "' + (Browsers.os.version ? Browsers.os.version.toString() : '') + '",' +
137
 
                                                                        '"deviceManufacturer": "' + (Browsers.device.manufacturer ? Browsers.device.manufacturer : '') + '",' +
138
 
                                                                        '"deviceModel": "' + (Browsers.device.model ? Browsers.device.model : '') + '",' +
139
 
                                                                        '"deviceSeries": "' + (Browsers.device.series ? Browsers.device.series : '') + '",' +
140
 
                                                                        '"deviceType": "' + (Browsers.device.type ? Browsers.device.type : '') + '",' +
141
 
                                                                        '"deviceIdentified": "' + (Browsers.device.identified ? '1' : '0' ) + '",' +
142
 
                                                                        '"deviceWidth": "' + (screen.width) + '",' +
143
 
                                                                        '"deviceHeight": "' + (screen.height) + '",' +
144
 
                                                                        '"useragent": "' + navigator.userAgent + '",' +
145
 
                                                                        '"humanReadable": "' + Browsers.toString() + '",' +
146
 
                                                                        '"points": "' + c.points + '",' +
147
 
                                                                        '"results": "' + r.results + '"' +
148
 
                                                                        '}';
149
 
 
150
 
                                        submit('submit', payload);
151
 
 
152
 
                                        function submit(method, payload) {
153
 
                                                var httpRequest;
154
 
                                                if (window.XMLHttpRequest) {
155
 
                                                        httpRequest = new XMLHttpRequest();
156
 
                                                } else if (window.ActiveXObject) {
157
 
                                                        httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
158
 
                                                }
159
 
 
160
 
                                                httpRequest.open('POST','/api/' + method, true);
161
 
                                                httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
162
 
                                                httpRequest.send('payload=' + encodeURIComponent(payload));
163
 
                                        }
164
 
                                },
165
 
 
166
 
                                function(e) {
167
 
                                        if (typeof console != 'undefined') console.log(e);
168
 
                                        alert('Test has failed: ' + e.message);
169
 
                                });
170
 
                        }
171
 
 
172
 
 
173
 
                //-->
174
 
                </script>
175
 
        </body>
176
 
</html>