<commit_before>/*
 * Copyright 2013 <NAME>.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

Aria.classDefinition({
    $classpath : "test.aria.widgets.form.autocomplete.expandbutton.test3.ExpandButtonCheck",
    $extends : "aria.jsunit.TemplateTestCase",
    $dependencies : ["aria.core.Timer"],
    $constructor : function () {
        this.$TemplateTestCase.constructor.call(this);
        this.dataModel = {
            value1 : ""
        };
        this.setTestEnv({
            data : this.dataModel
        });
        // this.defaultTestTimeout = 2000;
    },
    $prototype : {

        /**
         * This method is always the first entry point to a template test Start the test by focusing the first field
         */
        runTemplateTest : function () {
            var field = this.getInputField("ac1");
            field.focus();
            aria.core.Timer.addCallback({
                fn : this._downArrow,
                scope : this,
                delay : 25
            });
        },
        _downArrow : function () {
            this.synEvent.type(this.getInputField("ac1"), "[down]", {
                fn : this._addDelay,
                scope : this
            });
        },

        _addDelay : function () {
            aria.core.Timer.addCallback({
                fn : this._checkSelected,
                scope : this,
                delay : 1000
            });
        },

        _checkSelected : function () {
            this.synEvent.type(this.getInputField("ac1"), "[down][down][enter]", {
                fn : this._checkFinalVal,
                scope : this
            });
        },

        _checkFinalVal : function () {
            this.assertTrue(this.getInputField("ac1").value == "Finnair");
            this._finishTest();
        },

        _finishTest : function () {
            this.getInputField("ac1").blur();
            var data = aria.utils.Json.getValue(this.dataModel, "value1");
            this.assertTrue(data.label == "Finnair");
            this.notifyTemplateTestEnd();
        }

    }
});<commit_msg>fix test.aria.widgets.form.autocomplete.expandbutton.test3.ExpandButtonCheck fails in IE11, mentioned in #950<commit_after>/*
 * Copyright 2013 <NAME>.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

Aria.classDefinition({
    $classpath : "test.aria.widgets.form.autocomplete.expandbutton.test3.ExpandButtonCheck",
    $extends : "aria.jsunit.RobotTestCase",
    $dependencies : ["aria.core.Timer"],
    $constructor : function () {
        this.$RobotTestCase.constructor.call(this);
        this.dataModel = {
            value1 : ""
        };
        this.setTestEnv({
            data : this.dataModel
        });
        // this.defaultTestTimeout = 2000;
    },
    $prototype : {

        /**
         * This method is always the first entry point to a template test Start the test by focusing the first field
         */
        runTemplateTest : function () {
            var field = this.getInputField("ac1");
            field.focus();
            aria.core.Timer.addCallback({
                fn : this._downArrow,
                scope : this,
                delay : 25
            });
        },
        
        _downArrow : function () {
            var field = this.getInputField("ac1");
            this.synEvent.execute([["click", field], ["type", field, "[down]"], ["pause", 500],
                    ["type", field, "[down][down]\r"], ["pause", 500]], {
                fn : this._checkFinalVal,
                scope : this
            });
        },

        _checkFinalVal : function () {
            this.assertTrue(this.getInputField("ac1").value == "Finnair");
            this._finishTest();
        },

        _finishTest : function () {
            this.getInputField("ac1").blur();
            var data = aria.utils.Json.getValue(this.dataModel, "value1");
            this.assertTrue(data.label == "Finnair");
            this.notifyTemplateTestEnd();
        }

    }
});
{'fraction_non_alphanumeric': 0.11858654422040328, 'fraction_numerical': 0.01177879816330605, 'mean_word_length': 1.9401408450704225, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5014595', 'n_tokens_mistral': 1353, 'n_tokens_neox': 1286, 'n_words': 349}