Skip to content

Commit

Permalink
Fixed save/load crash in FF38 by renaming mentions of 'Preferences' t…
Browse files Browse the repository at this point in the history
…o 'Prefs'.
  • Loading branch information
Zarkonnen committed May 18, 2015
1 parent 6f9c48a commit 3e16165
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,4 @@ builder.dialogs.exportscript.saveAs = function() {



if (builder && builder.loader && builder.loader.loadNextMainScript) { builder.loader.loadNextMainScript(); }
if (builder && builder.loader && builder.loader.loadNextMainScript) { builder.loader.loadNextMainScript(); }
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var fc = new bridge.FormatCollection(bridge.SeleniumIDE.Preferences.DEFAULT_OPTIONS);
var fc = new bridge.FormatCollection(bridge.SeleniumIDE.Prefs.DEFAULT_OPTIONS);
var format = fc.findFormat('default');
var tc = new bridge.TestCase();
format.saveAs(tc);
format.saveAs(tc);
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ builder.selenium1.adapter.exportScriptWithFormatToPath = function(script, format
};

builder.selenium1.adapter.formatCollection = function() {
return new bridge.FormatCollection(bridge.SeleniumIDE.Preferences.DEFAULT_OPTIONS);
return new bridge.FormatCollection(bridge.SeleniumIDE.Prefs.DEFAULT_OPTIONS);
};

builder.selenium1.adapter.findBaseUrl = function(script) {
Expand Down Expand Up @@ -382,4 +382,4 @@ builder.selenium1.io.getSaveSuiteFormat = function() {



if (builder && builder.loader && builder.loader.loadNextMainScript) { builder.loader.loadNextMainScript(); }
if (builder && builder.loader && builder.loader.loadNextMainScript) { builder.loader.loadNextMainScript(); }
4 changes: 2 additions & 2 deletions seleniumbuilder/chrome/content/html/js/selenium-ide/format.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ FormatCollection.prototype.getDefaultFormat = function() {

FormatCollection.loadPluginFormats = function(options) {
var formats = [];
var pluginProvided = SeleniumIDE.Preferences.getString("pluginProvidedFormatters");
var pluginProvided = SeleniumIDE.Prefs.getString("pluginProvidedFormatters");

if (pluginProvided) {
var split_pluginProvided = pluginProvided.split(",");
Expand Down Expand Up @@ -517,4 +517,4 @@ PluginFormat.prototype.getSource = function() {

PluginFormat.prototype.getFormatURI = function() {
return this.url;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

if (!this.SeleniumIDE) this.SeleniumIDE = {};

SeleniumIDE.Preferences = {
SeleniumIDE.Prefs = {
TEST_BRANCH: Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch("extensions.selenium-ide.test."),
branch: Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch("extensions.selenium-ide."),

Expand Down Expand Up @@ -111,7 +111,7 @@ SeleniumIDE.Preferences = {
}
};

SeleniumIDE.Preferences.DEFAULT_OPTIONS = {
SeleniumIDE.Prefs.DEFAULT_OPTIONS = {
encoding: "UTF-8",

// This should be called 'userExtensionsPaths', but it is left for backward compatibility.
Expand Down Expand Up @@ -150,4 +150,4 @@ SeleniumIDE.Preferences.DEFAULT_OPTIONS = {

recordOnOpen:
"true"
};
};
16 changes: 8 additions & 8 deletions seleniumbuilder/chrome/content/html/js/selenium-ide/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
* limitations under the License.
*/

if (this.SeleniumIDE && SeleniumIDE.Preferences) {
this.Preferences = SeleniumIDE.Preferences;
if (this.SeleniumIDE && SeleniumIDE.Prefs) {
this.Prefs = SeleniumIDE.Prefs;
} else {
// Preferences is not available when called from xlator
this.Preferences = {
// Prefs is not available when called from xlator
this.Prefs = {
getString: function(name, defaultValue) {
return defaultValue;
}
Expand Down Expand Up @@ -55,7 +55,7 @@ function Log(category) {
Log.prototype = {
_getThreshold: function() {
if (!this.threshold) {
this.threshold = Preferences.getString("internalLogThreshold", "INFO");
this.threshold = Prefs.getString("internalLogThreshold", "INFO");
}
return this.threshold;
},
Expand Down Expand Up @@ -94,7 +94,7 @@ function showFilePicker(window, title, mode, defaultDirPrefName, handler, defaul
var nsIFilePicker = Components.interfaces.nsIFilePicker;
var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
fp.init(window, title, mode);
var defaultDir = Preferences.getString(defaultDirPrefName);
var defaultDir = Prefs.getString(defaultDirPrefName);
if (defaultDir) {
fp.displayDirectory = SeFileUtils.getFile(defaultDir);
}
Expand All @@ -104,7 +104,7 @@ function showFilePicker(window, title, mode, defaultDirPrefName, handler, defaul
}
var res = fp.show();
if (res == nsIFilePicker.returnOK || res == nsIFilePicker.returnReplace) {
Preferences.setString(defaultDirPrefName, fp.file.parent.path);
Prefs.setString(defaultDirPrefName, fp.file.parent.path);
return handler(fp);
} else {
return null;
Expand Down Expand Up @@ -268,4 +268,4 @@ function defineEnum(clazz, names) {

function $(id) {
return document.getElementById(id);
}
}
2 changes: 1 addition & 1 deletion seleniumbuilder/chrome/content/seleniumBuilder2.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,4 +290,4 @@ bridge.SeleniumIDE = SeleniumIDE;
bridge.TestCase = TestCase;
bridge.TestSuite = TestSuite;
bridge.showFilePicker = showFilePicker;
bridge.Format = Format;
bridge.Format = Format;

0 comments on commit 3e16165

Please sign in to comment.