How to use the ariatemplates/utils/Function.bind function in ariatemplates

To help you get started, we’ve selected a few ariatemplates examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ariatemplates / ariatemplates / test / aria / utils / FunctionTestCase.js View on Github external
// check arguments
                oSelf.assertTrue(a === 1);
                oSelf.assertTrue(b === 2);
                oSelf.assertTrue(c === 3);
                oSelf.assertTrue(d === 4);
                oSelf.assertTrue(!e);

                // check scope
                oSelf.assertTrue(this === scope);

                // validate execution
                executed = true;
            };

            // creates the binded function
            var binded = ariaUtilsFunction.bind(myFunction, scope, 1, 2);

            // call it several time to be sure parameters are still ok
            binded(3, 4);
            binded(3, 4);

            this.assertTrue(executed);
        },
github ariatemplates / ariatemplates / test / aria / widgets / wai / tabs / update1 / TabsUpdate1JawsTestCase.js View on Github external
runTemplateTest : function () {
            var regexps = [];
            regexps.push(/Use JawsKey\+Alt\+M to move to controlled element/g);
            regexps.push(this._createLineRegExp(' *')); // empty line
            regexps.push(/ +(?=\s)/g); // multiple consecutive spaces
            regexps.push(this._createLineRegExp(this._getData().elementBefore.textContent));

            this._filter = ariaUtilsFunction.bind(this._applyRegExps, this, regexps);

            this._localAsyncSequence(function (add) {
                add('_test');
                add('_checkHistory');
            }, this.end);
        },
github ariatemplates / ariatemplates / test / aria / widgets / wai / autoComplete / AutoCompleteRobotBase.js View on Github external
initialSetup : function() {
            this.myAutoCompleteWidget = this.getWidgetInstance(this.myAutoCompleteId);
            var checkFn = this.myAutoCompleteAccessible ? this.checkAccessibilityEnabled : this.checkAccessibilityDisabled;
            this.myAutoCompleteCheckFn = fnUtils.bind(checkFn, this, this.myAutoCompleteWidget);
        },
github ariatemplates / ariatemplates / test / aria / widgets / wai / input / actionWidget / JawsBase.js View on Github external
ariaUtilsArray.forEach(traversals, function(traversal) {
                    var key = traversal.key;
                    var name = traversal.name;

                    var traversalTestData = testData[traversal.name];
                    var actionsCount = traversalTestData.actionsCount;
                    var expectedOutput = traversalTestData.expectedOutput;

                    selectStartPoint();
                    ariaUtilsAlgo.times(actionsCount, ariaUtilsFunction.bind(specialKey, null, key));
                    says(expectedOutput.join('\n'));
                });
            });
github ariatemplates / ariatemplates / test / aria / widgets / wai / input / actionWidget / TplScript.js View on Github external
_filterWidgetsTypes: function(widgetsTypes) {
            return ariaUtilsArray.filter(
                widgetsTypes,
                ariaUtilsFunction.bind(this._keepWidgetTypePredicate, this)
            );
        },
github ariatemplates / ariatemplates / test / aria / core / ResMgr2TestCase.js View on Github external
$constructor : function () {
        this.$TestCase.constructor.call(this);
        this.handleAsyncTestError = ariaUtilsFunction.bind(this.handleAsyncTestError, this);
    },
    $destructor : function () {
github ariatemplates / ariatemplates / test / EnhancedJawsBase.js View on Github external
function autoBindAndAlias(container, spec) {
    var method = ariaUtilsFunction.bind(container[spec.name], container);

    ariaUtilsArray.forEach(spec.aliases, function(alias) {
        container[alias] = method;
    });

    return method;
}
github ariatemplates / ariatemplates / test / aria / widgets / wai / tabs / TabsJawsTestCase.js View on Github external
runTemplateTest : function () {
            var regexps = [];
            regexps.push(this._createLineRegExp('Element before .*'));
            regexps.push(this._createLineRegExp('separator'));
            regexps.push(this._createLineRegExp('AT test*'));
            regexps.push(/Use JawsKey\+Alt\+M to move to controlled element\s*/g);

            this._filter = ariaUtilsFunction.bind(this._applyRegExps, this, regexps);

            this._localAsyncSequence(function (add) {
                add('_testGroups');
                add('_checkHistory');
            }, this.end);
        },