<commit_before>// Copyright © 2014 Intel Corporation. All rights reserved.
// Use  of this  source  code is  governed by  an Apache v2
// license that can be found in the LICENSE-APACHE-V2 file.

// Run tests silently to avoid spew from tests failing on purpose.
require("../src/Config").getInstance().setSilentConsole(false);
var AndroidPlatform = require("../src/android/AndroidPlatform");
var PlatformBase = require("../src/PlatformBase");
var Util = require("./util/Util.js");

exports.tests = {

    stableLatest: function(test) {

        test.expect(1);

        var application = Util.createTmpApplication("com.example.foo");
        var platformData = {
            application: application,
            platformId: "android"
        };

        var android = new AndroidPlatform(PlatformBase, platformData);
        android.findCrosswalkVersion(null, "stable",
                                     function(version, channel, errormsg) {

            test.equal(typeof version, "string");

            Util.deleteTmpApplication(application);
            test.done();
        });
    },

    beta: function(test) {

        test.expect(2);

        var application = Util.createTmpApplication("com.example.foo");
        var platformData = {
            application: application,
            platformId: "android"
        };

        var android = new AndroidPlatform(PlatformBase, platformData);
        var versionSought = "12.41.296.4";
        var channelSought = "beta";
        android.findCrosswalkVersion(versionSought, null,
                                     function(version, channel, errormsg) {

            test.equal(version, versionSought);
            test.equal(channel, channelSought);

            Util.deleteTmpApplication(application);
            test.done();
        });
    }
};
<commit_msg>test: Add failing testcase in android-platform.js<commit_after>// Copyright © 2014 Intel Corporation. All rights reserved.
// Use  of this  source  code is  governed by  an Apache v2
// license that can be found in the LICENSE-APACHE-V2 file.

// Run tests silently to avoid spew from tests failing on purpose.
require("../src/Config").getInstance().setSilentConsole(false);
var AndroidPlatform = require("../src/android/AndroidPlatform");
var PlatformBase = require("../src/PlatformBase");
var Util = require("./util/Util.js");

exports.tests = {

    stableLatest: function(test) {

        test.expect(1);

        var application = Util.createTmpApplication("com.example.foo");
        var platformData = {
            application: application,
            platformId: "android"
        };

        var android = new AndroidPlatform(PlatformBase, platformData);
        android.findCrosswalkVersion(null, "stable",
                                     function(version, channel, errormsg) {

            test.equal(typeof version, "string");

            Util.deleteTmpApplication(application);
            test.done();
        });
    },

    beta: function(test) {

        test.expect(2);

        var application = Util.createTmpApplication("com.example.foo");
        var platformData = {
            application: application,
            platformId: "android"
        };

        var android = new AndroidPlatform(PlatformBase, platformData);
        var versionSought = "12.41.296.4";
        var channelSought = "beta";
        android.findCrosswalkVersion(versionSought, null,
                                     function(version, channel, errormsg) {

            test.equal(version, versionSought);
            test.equal(channel, channelSought);

            Util.deleteTmpApplication(application);
            test.done();
        });
    },

    invalid: function(test) {

        test.expect(2);

        var application = Util.createTmpApplication("com.example.foo");
        var platformData = {
            application: application,
            platformId: "android"
        };

        var android = new AndroidPlatform(PlatformBase, platformData);
        android.findCrosswalkVersion("0.0.0.0", null,
                                     function(version, channel, errormsg) {

            test.equal(version, null);
            test.equal(channel, null);

            Util.deleteTmpApplication(application);
            test.done();
        });
    }
};

{'fraction_non_alphanumeric': 0.1112143022985837, 'fraction_numerical': 0.008590666357093104, 'mean_word_length': 2.158357771260997, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1518794', 'n_tokens_mistral': 1123, 'n_tokens_neox': 1075, 'n_words': 257}