ie.html 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
  6. <link rel="stylesheet" href="test.css">
  7. <title>Zepto Touch unit tests</title>
  8. <script src="../vendor/evidence.js"></script>
  9. <script src="evidence_runner.js"></script>
  10. <script>
  11. // avoid caching
  12. (function(){
  13. function load(scripts){
  14. scripts.split(' ').forEach(function(script){
  15. document.write('<script src="../src/'+script+'.js?'+(+new Date)+'"></scr'+'ipt>')
  16. })
  17. }
  18. load('ie')
  19. })()
  20. </script>
  21. <style>
  22. body {
  23. height: 50px;
  24. }
  25. body:after {
  26. content: 'abc';
  27. }
  28. </style>
  29. </head>
  30. <body>
  31. <h1>Zepto ie unit tests</h1>
  32. <p id="results">
  33. Running… see browser console for results
  34. </p>
  35. <script>
  36. (function(){
  37. Evidence('getComputedStyle', {
  38. //Test to check if getComputedStyle does not blow up when no element are provided
  39. testGetComputedStyleNoElem: function(t){
  40. t.assertEqual(null, getComputedStyle())
  41. },
  42. //Test to check if computed styles for elements are returned correctly
  43. testGetComputedStyle: function(t){
  44. t.assertEqual('50px', getComputedStyle(document.body).height)
  45. },
  46. //Test to check if computed styles for pseudo-elements are returned correctly
  47. //Assertion a bit hacky as IE returns the value in double quotes
  48. testGetComputedStylePseudoElem: function(t){
  49. t.assert(getComputedStyle(document.body, ':after').content.indexOf('abc') > -1)
  50. }
  51. })
  52. })()
  53. </script>
  54. </body>
  55. </html>