<commit_before>/*
 * Copyright 2005 <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.
 */

function Debugger(editor) {
	this.log = new Log("Debugger");
	this.editor = editor;
    this.pauseTimeout = 3000;
	var self = this;
	
	this.init = function() {
		if (this.runner != null) {
			// already initialized
			return;
		}
		
		this.log.debug("init");
        
        this.setState(Debugger.STOPPED);
        
		this.runner = new Object();
		this.runner.editor = this.editor;
        this.runner.setState = function(state) {
            self.setState(state);
        }
        this.editor.app.addObserver({
                testCaseChanged: function(testCase) {
                    self.runner.LOG.info("Changed test case");
                    self.runner.testCase = testCase;
                }
            });
		this.runner.testCase = this.editor.getTestCase();
		
		const subScriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
	    .getService(Components.interfaces.mozIJSSubScriptLoader);
		//subScriptLoader.loadSubScript('chrome://selenium-ide/content/selenium/selenium-logging.js', this.runner);

		subScriptLoader.loadSubScript('chrome://selenium-ide/content/selenium/scripts/selenium-api.js', this.runner);
		subScriptLoader.loadSubScript('chrome://selenium-ide/content/selenium/scripts/selenium-commandhandlers.js', this.runner);
		subScriptLoader.loadSubScript('chrome://selenium-ide/content/selenium/scripts/selenium-executionloop.js', this.runner);
		// atoms
		subScriptLoader.loadSubScript('chrome://selenium-ide/content/atoms/atoms.js', this.runner);
		subScriptLoader.loadSubScript('chrome://selenium-ide/content/atoms/atomic_core.js', this.runner);
		subScriptLoader.loadSubScript('chrome://selenium-ide/content/atoms/bot.js', this.runner);
		subScriptLoader.loadSubScript('chrome://selenium-ide/content/selenium/scripts/selenium-browserbot.js', this.runner);
		subScriptLoader.loadSubScript('chrome://selenium-ide/content/selenium/scripts/selenium-testrunner-original.js', this.runner);

		if (this.editor.getOptions().userExtensionsURL) {
			try {
				ExtensionsLoader.loadSubScript(subScriptLoader, this.editor.getOptions().userExtensionsURL, this.runner);
			} catch (error) {
				this.log.error("error loading user-extensions.js: " + error);
			}
		}
		
        var pluginProvided = SeleniumIDE.Preferences.getString("pluginProvidedUserExtensions");
        if (typeof pluginProvided != 'undefined') {
            try {
                var split_pluginProvided = pluginProvided.split(",");<commit_msg>AdamGoucher - second half of Simon's r10466<commit_after>/*
 * Copyright 2005 <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.
 */

function Debugger(editor) {
	this.log = new Log("Debugger");
	this.editor = editor;
    this.pauseTimeout = 3000;
	var self = this;
	
	this.init = function() {
		if (this.runner != null) {
			// already initialized
			return;
		}
		
		this.log.debug("init");
        
        this.setState(Debugger.STOPPED);
        
		this.runner = new Object();
		this.runner.editor = this.editor;
        this.runner.setState = function(state) {
            self.setState(state);
        }
        this.editor.app.addObserver({
                testCaseChanged: function(testCase) {
                    self.runner.LOG.info("Changed test case");
                    self.runner.testCase = testCase;
                }
            });
		this.runner.testCase = this.editor.getTestCase();
		
		const subScriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
	    .getService(Components.interfaces.mozIJSSubScriptLoader);
		//subScriptLoader.loadSubScript('chrome://selenium-ide/content/selenium/selenium-logging.js', this.runner);

		subScriptLoader.loadSubScript('chrome://selenium-ide/content/selenium/scripts/selenium-api.js', this.runner);
		subScriptLoader.loadSubScript('chrome://selenium-ide/content/selenium/scripts/selenium-commandhandlers.js', this.runner);
		subScriptLoader.loadSubScript('chrome://selenium-ide/content/selenium/scripts/selenium-executionloop.js', this.runner);
		// atoms
		subScriptLoader.loadSubScript('chrome://selenium-ide/content/selenium/scripts/atoms.js', this.runner);
		subScriptLoader.loadSubScript('chrome://selenium-ide/content/selenium/scripts/selenium-browserbot.js', this.runner);
		subScriptLoader.loadSubScript('chrome://selenium-ide/content/selenium/scripts/selenium-testrunner-original.js', this.runner);

		if (this.editor.getOptions().userExtensionsURL) {
			try {
				ExtensionsLoader.loadSubScript(subScriptLoader, this.editor.getOptions().userExtensionsURL, this.runner);
			} catch (error) {
				this.log.error("error loading user-extensions.js: " + error);
			}
		}
		
        var pluginProvided = SeleniumIDE.Preferences.getString("pluginProvidedUserExtensions");
        if (typeof pluginProvided != 'undefined') {
            try {
                var split_pluginProvided = pluginProvided.split(",");
{'fraction_non_alphanumeric': 0.12409981577625188, 'fraction_numerical': 0.00519176017417518, 'mean_word_length': 3.4600448095593728, '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': '2468608', 'n_tokens_mistral': 1855, 'n_tokens_neox': 1688, 'n_words': 336}