Skip to content

Commit

Permalink
Why hello, caniuse.com test suite! This is big! ... details below:
Browse files Browse the repository at this point in the history
Caniuse has a great collection of visual ref tests, side by side with the Modernizr feature test.

This allows us to visually see these features and verify they match our feature tests.

Everything in the caniuse suite works, except for the audio/video tests.

The huge benefit is that now we can screenshot this one page (on a mobile device per say),
and get the full rundown of its features, even being able to point out any false
positives.

Thanks Alexis Deveria for creating such a great collection of tests. :)
  • Loading branch information
paulirish committed May 25, 2011
1 parent cb0717d commit f68ea41
Show file tree
Hide file tree
Showing 33 changed files with 2,056 additions and 0 deletions.
1,432 changes: 1,432 additions & 0 deletions test/caniuse.html

Large diffs are not rendered by default.

Binary file added test/caniuse_files/Windsong-webfont.eot
Binary file not shown.
Binary file added test/caniuse_files/Windsong-webfont.otf
Binary file not shown.
147 changes: 147 additions & 0 deletions test/caniuse_files/Windsong-webfont.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/caniuse_files/Windsong-webfont.ttf
Binary file not shown.
Binary file added test/caniuse_files/Windsong-webfont.woff
Binary file not shown.
Binary file added test/caniuse_files/alpha.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/caniuse_files/apng_test.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/caniuse_files/before-after.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions test/caniuse_files/form_validation.html
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<!-- saved from url=(0045)http://tests.caniuse.com/form_validation.html -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><script>
if(location.href.indexOf('?') >= 0) {
document.write('FAIL');
}
</script>

</head><body><form action="http://tests.caniuse.com/form_validation.html?" method="post">

<input type="url" name="foo" required="">
<input type="submit" value="submit me!">

</form>
</body></html>
43 changes: 43 additions & 0 deletions test/caniuse_files/ga.js

Large diffs are not rendered by default.

Binary file added test/caniuse_files/green5x5.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions test/caniuse_files/hashchange.html
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>hashchange test</title>
</head>
<body style="background:red;overflow:hidden;">
<script>
addEventListener('hashchange', function() {
document.body.style.background = 'lime';
}, false);

location.hash = Math.random();
</script>
</body>
</html>
18 changes: 18 additions & 0 deletions test/caniuse_files/jquery.min.js

Large diffs are not rendered by default.

120 changes: 120 additions & 0 deletions test/caniuse_files/mathml.html
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xmlns:html="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Untitled</title>
</head>
<body>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow>
<mi>k</mi>
<mo>=</mo>
<mfrac>
<mrow>
<mfrac>
<mrow>
<msup>
<mo></mo>
<mn>2</mn>
</msup>
<mi>z</mi>
</mrow>
<mrow>
<mo></mo>
<msup>
<mi>x</mi>
<mn>2</mn>
</msup>
</mrow>
</mfrac>
<mfrac>
<mrow>
<msup>
<mo></mo>
<mn>2</mn>
</msup>
<mi>z</mi>
</mrow>
<mrow>
<mo></mo>
<msup>
<mi>y</mi>
<mn>2</mn>
</msup>
</mrow>
</mfrac>
<mo>-</mo>
<msup>
<mrow>
<mo>(</mo>
<mfrac>
<mrow>
<msup>
<mo></mo>
<mn>2</mn>
</msup>
<mi>z</mi>
</mrow>
<mrow>
<mo></mo>
<mi>x</mi>
<mo></mo>
<mi>y</mi>
</mrow>
</mfrac>
<mo>)</mo>
</mrow>
<mn>2</mn>
</msup>
</mrow>
<mrow>
<msup>
<mrow>
<mo>(</mo>
<mn>1</mn>
<mo>+</mo>
<msup>
<mrow>
<mo>(</mo>
<mfrac>
<mrow>
<mo></mo>
<mi>z</mi>
</mrow>
<mrow>
<mo></mo>
<mi>x</mi>
</mrow>
</mfrac>
<mo>)</mo>
</mrow>
<mn>2</mn>
</msup>
<mo>+</mo>
<msup>
<mrow>
<mo>(</mo>
<mfrac>
<mrow>
<mo></mo>
<mi>z</mi>
</mrow>
<mrow>
<mo></mo>
<mi>y</mi>
</mrow>
</mfrac>
<mo>)</mo>
</mrow>
<mn>2</mn>
</msup>
<mo>)</mo>
</mrow>
<mn>2</mn>
</msup>
</mrow>
</mfrac>
</mrow>
</math>
</body>
</html>
Binary file added test/caniuse_files/mathml_ref.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions test/caniuse_files/modernizr-1.7.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added test/caniuse_files/png_alpha_result.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions test/caniuse_files/pushstate.html
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>popstate event test</title>
</head>
<body>

<script>

(function() {
var test_id;

function showResult(r) {
if(test_id && window.parent.setResult) {
parent.setResult(test_id, r);
} else {
alert(r);
}
}

if(location.hash.length) {
test_id = location.hash.substr(1);
}

if(history.pushState) {
var rand = Math.random();
setTimeout(function() {
history.pushState({foo: 'bar'}, "title", './' + rand);
var result = (location.href.indexOf(rand) > -1);
showResult(result);
}, 100);
}

})();

</script>

</body>
</html>
Binary file added test/caniuse_files/red30x30.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/caniuse_files/ruby.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/caniuse_files/stroked-text.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
168 changes: 168 additions & 0 deletions test/caniuse_files/style.css
@@ -0,0 +1,168 @@
body {
font-family: "Lucida Grande", Lucida, Verdana, sans-serif;
font-size: 12px;
}

a {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}

table, tr, th, td {
border: 1px solid #AAA;
}

table {
margin-top: 1em;
width: 100%;
}

tbody th {
text-align: left;
font-size: 14px;
width: 200px;
}

th h3 {
margin: 3px;
font-size: 12px;
}

th span.links {
font-size: 10px;
}

dt {
font-weight: bold;
}

tr:hover > th,
tr:hover > td + td { background-color: #FFC; }

div.test_wrap {
display: -moz-inline-stack;
display: inline-block;
border: 1px solid #CCC;
text-align: center;
vertical-align: top;
min-height: 50px;
margin-right: 5px;
background: white;
position: relative;
}

div.test_wrap h3 {
text-align: center;
margin: 2px;
font-size: 10px;
}

div.auto {
display: -moz-inline-stack;
display: inline-block;
border: 1px solid;
width: 30px;
height: 30px;
}

div.square {
display: -moz-inline-stack;
display: inline-block;
border: 1px solid;
width: 30px;
height: 30px;
background: red;
}

div.info {
display: none;
position: absolute;
top: 100%;
z-index: 2;
left: 0;
background: white;
padding: 2px;
min-width: 300px;
border: 1px solid;
text-align: left;
}

div.test_wrap:hover > div.info {
display: block;
}


div.vis_test {
display: -moz-inline-stack;
display: inline-block;
}

div.vis_ref {
display: -moz-inline-stack;
display: inline-block;
border-left: 1px dashed black;
margin-left: 5px;
padding-left: 5px;
vertical-align: top;
}

p.condition {
font-style: italic;
margin: 2px;
clear: both;
}

.pass {
background: lime;
}

.fail {
background: red;
}

.partial {
background: yellow;
}

.unknown {
background: #aaa;
}

.current span {
border-radius: 6px;
-moz-border-radius: 6px;
background: none repeat scroll 0 0 #E6EA69;
color: black;
float: right;
font-size: 8px;
padding: 0 1px;
}

#intro, #options {
width: 400px;
background: #EEE;
border-radius: 10px;
padding: 5px 10px;
margin: 10px;
float: left;
}

#intro dt::after {
content: ':';
}

#intro dd {
margin-bottom: 1em;
}

#opt_submit {
display: block;
margin: 10px;
}

#options label {
display: block;
margin: 5px;
}
Binary file added test/caniuse_files/svg-html-blur.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions test/caniuse_files/svg-img.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions test/caniuse_files/svg-img.svg.1
@@ -0,0 +1,5 @@
<?xml version="1.0"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">
<rect fill="#00ff00" x="0" y="0" width="30" height="30">
</rect>
</svg>
Binary file added test/caniuse_files/svg_blur.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/caniuse_files/table.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/caniuse_files/text-shadow1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/caniuse_files/text-shadow2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/caniuse_files/windsong_font.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f68ea41

Please sign in to comment.