Skip to content

Commit

Permalink
fix test for rAF to account for unprefixed possibility
Browse files Browse the repository at this point in the history
  • Loading branch information
SlexAxton committed Dec 5, 2012
1 parent 728a5d9 commit bb6ed03
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test/js/unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ if(navigator.userAgent.indexOf("PhantomJS") === -1) {
QUnit.config.autostart = false;
}

// Save the classes before we add a bunch to them via tests
var classes = TEST.trim(document.documentElement.className).split(/\s+/);

module('Basics', {
setup:function() {
},
Expand Down Expand Up @@ -127,7 +130,6 @@ module('Modernizr classes and bools', {

test('html classes are looking good',function(){

var classes = TEST.trim(document.documentElement.className).split(/\s+/);

var modprops = Object.keys(Modernizr),
newprops = modprops;
Expand Down Expand Up @@ -199,7 +201,7 @@ test('Modernizr properties are looking good',function(){
nobool = TEST.API.concat(TEST.inputs)
.concat(TEST.audvid)
.concat(TEST.privates)
.concat(['textarea']); // due to forms-placeholder.js test
.concat(['textarea', 'testtruthy', 'testfalsy']); // due to forms-placeholder.js test

for (var prop in window.Modernizr){
if (Modernizr.hasOwnProperty(prop)){
Expand Down Expand Up @@ -545,6 +547,11 @@ test('Modernizr.prefixed autobind', function(){
rAFName = window[vendors[x]+'RequestAnimationFrame'] && vendors[x]+'RequestAnimationFrame';
}

// Some browsers have the unprefixed now
if (typeof window.requestAnimationFrame === 'function') {
rAFName = 'requestAnimationFrame';
}

if (rAFName){
// rAF returns a function
equal(
Expand Down

0 comments on commit bb6ed03

Please sign in to comment.