<commit_before>/* global module, asyncTest, $, ok, equal, notEqual, start, test, Util, testLog */

(function () {
    var viewer;

    module('Basic', {
        setup: function () {
            var example = $('<div id="rotateTests"></div>').appendTo("#qunit-fixture");

            testLog.reset();

        },
        teardown: function () {
            if (viewer && viewer.close) {
                viewer.close();
            }

            viewer = null;
        }
    });

    asyncTest('RotateControlOff', function () {

        var openHandler = function (event) {
            viewer.removeHandler('open', openHandler);
            ok(true, 'Open event was sent');
            ok(viewer.drawer, 'Drawer exists');
            ok(viewer.drawer.canRotate(), 'drawer.canRotate needs to be true');
            ok(!viewer.showRotationControl, 'showRotationControl should be off');
            ok(!viewer.rotateLeft, "rotateLeft button should be null");
            ok(!viewer.rotateRight, "rotateRight button should be null");
            start();
        };

        viewer = OpenSeadragon({
            id:             'rotateTests',
            prefixUrl:      '/build/openseadragon/images/',
            springStiffness: 100, // Faster animation = faster tests
            showRotationControl: false
        });
        viewer.addHandler('open', openHandler);
        viewer.open('/test/data/testpattern.dzi');
    });

    asyncTest('RotateControlOn', function () {

        var openHandler = function (event) {
            viewer.removeHandler('open', openHandler);
            ok(true, 'Open event was sent');
            ok(viewer.drawer, 'Drawer exists');
            ok(viewer.drawer.canRotate(), 'drawer.canRotate needs to be true');
            ok(viewer.showRotationControl, 'showRotationControl should be true');
            ok(-1 != viewer.buttons.buttons.indexOf(viewer.rotateLeft), "rotateLeft should be found");
            ok(-1 != viewer.buttons.buttons.indexOf(viewer.rotateRight), "rotateRight should be found");

            // Now simulate the left/right button clicks. Security prevents us from simulating a click,
            // so we will call the 'onRelease' handler for the button
            ok(viewer.viewport.degrees === 0, "Image should start at 0 degrees rotation");
            viewer.rotateLeft.onRelease();<commit_msg> comment update on rotate test<commit_after>/* global module, asyncTest, $, ok, equal, notEqual, start, test, Util, testLog */

(function () {
    var viewer;

    module('Basic', {
        setup: function () {
            var example = $('<div id="rotateTests"></div>').appendTo("#qunit-fixture");

            testLog.reset();

        },
        teardown: function () {
            if (viewer && viewer.close) {
                viewer.close();
            }

            viewer = null;
        }
    });

    asyncTest('RotateControlOff', function () {

        var openHandler = function (event) {
            viewer.removeHandler('open', openHandler);
            ok(true, 'Open event was sent');
            ok(viewer.drawer, 'Drawer exists');
            ok(viewer.drawer.canRotate(), 'drawer.canRotate needs to be true');
            ok(!viewer.showRotationControl, 'showRotationControl should be off');
            ok(!viewer.rotateLeft, "rotateLeft button should be null");
            ok(!viewer.rotateRight, "rotateRight button should be null");
            start();
        };

        viewer = OpenSeadragon({
            id:             'rotateTests',
            prefixUrl:      '/build/openseadragon/images/',
            springStiffness: 100, // Faster animation = faster tests
            showRotationControl: false
        });
        viewer.addHandler('open', openHandler);
        viewer.open('/test/data/testpattern.dzi');
    });

    asyncTest('RotateControlOn', function () {

        var openHandler = function (event) {
            viewer.removeHandler('open', openHandler);
            ok(true, 'Open event was sent');
            ok(viewer.drawer, 'Drawer exists');
            ok(viewer.drawer.canRotate(), 'drawer.canRotate needs to be true');
            ok(viewer.showRotationControl, 'showRotationControl should be true');
            ok(-1 != viewer.buttons.buttons.indexOf(viewer.rotateLeft), "rotateLeft should be found");
            ok(-1 != viewer.buttons.buttons.indexOf(viewer.rotateRight), "rotateRight should be found");

            // Now simulate the left/right button clicks.
            // TODO: re-factor simulateViewerClickWithDrag so it'll accept any element, and use that.
            ok(viewer.viewport.degrees === 0, "Image should start at 0 degrees rotation");
            viewer.rotateLeft.onRelease();
{'fraction_non_alphanumeric': 0.1271994912020352, 'fraction_numerical': 0.002967988128047488, 'mean_word_length': 2.183535762483131, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '6668128', 'n_tokens_mistral': 1290, 'n_tokens_neox': 1242, 'n_words': 316}