mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Backed out changesets c6380188c418 and cc9ff30e82d6 for possible Android debug asserts/crashes.
CLOSED TREE
This commit is contained in:
parent
25a861dd5c
commit
2f893755da
@ -68,11 +68,6 @@ MozSelfSupportInterface.prototype = {
|
||||
resetPref: function(name) {
|
||||
Services.prefs.clearUserPref(name);
|
||||
},
|
||||
|
||||
resetSearchEngines: function() {
|
||||
Services.search.restoreDefaultEngines();
|
||||
Services.search.resetToOriginalDefaultEngine();
|
||||
},
|
||||
}
|
||||
|
||||
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([MozSelfSupportInterface]);
|
||||
|
@ -1,6 +1,6 @@
|
||||
Cu.import("resource://gre/modules/Preferences.jsm");
|
||||
|
||||
function test_resetPref() {
|
||||
function test() {
|
||||
const prefNewName = "browser.newpref.fake";
|
||||
Assert.ok(!Preferences.has(prefNewName), "pref should not exist");
|
||||
|
||||
@ -45,44 +45,3 @@ function test_resetPref() {
|
||||
// clearUserPref can't undo its action
|
||||
// see discussion in bug 1075160
|
||||
}
|
||||
|
||||
function test_resetSearchEngines()
|
||||
{
|
||||
const defaultEngineOriginal = Services.search.defaultEngine;
|
||||
const visibleEnginesOriginal = Services.search.getVisibleEngines();
|
||||
|
||||
// 1. do nothing on unchanged search configuration
|
||||
MozSelfSupport.resetSearchEngines();
|
||||
Assert.equal(Services.search.defaultEngine, defaultEngineOriginal, "default engine should be reset");
|
||||
Assert.deepEqual(Services.search.getVisibleEngines(), visibleEnginesOriginal,
|
||||
"default visible engines set should be reset");
|
||||
|
||||
// 2. change the default search engine
|
||||
const defaultEngineNew = visibleEnginesOriginal[3];
|
||||
Assert.notEqual(defaultEngineOriginal, defaultEngineNew, "new default engine should be different from original");
|
||||
Services.search.defaultEngine = defaultEngineNew;
|
||||
Assert.equal(Services.search.defaultEngine, defaultEngineNew, "default engine should be set to new");
|
||||
MozSelfSupport.resetSearchEngines();
|
||||
Assert.equal(Services.search.defaultEngine, defaultEngineOriginal, "default engine should be reset");
|
||||
Assert.deepEqual(Services.search.getVisibleEngines(), visibleEnginesOriginal,
|
||||
"default visible engines set should be reset");
|
||||
|
||||
// 3. remove an engine
|
||||
const engineRemoved = visibleEnginesOriginal[2];
|
||||
Services.search.removeEngine(engineRemoved);
|
||||
Assert.ok(Services.search.getVisibleEngines().indexOf(engineRemoved) == -1,
|
||||
"removed engine should not be visible any more");
|
||||
MozSelfSupport.resetSearchEngines();
|
||||
Assert.equal(Services.search.defaultEngine, defaultEngineOriginal, "default engine should be reset");
|
||||
Assert.deepEqual(Services.search.getVisibleEngines(), visibleEnginesOriginal,
|
||||
"default visible engines set should be reset");
|
||||
|
||||
// 4. add an angine
|
||||
// we don't remove user-added engines as they are only used if selected
|
||||
}
|
||||
|
||||
function test()
|
||||
{
|
||||
test_resetPref();
|
||||
test_resetSearchEngines();
|
||||
}
|
||||
|
@ -50,9 +50,4 @@ interface MozSelfSupport
|
||||
* The name of the pref to reset.
|
||||
*/
|
||||
void resetPref(DOMString name);
|
||||
|
||||
/**
|
||||
* Resets original search engines, and resets the default one.
|
||||
*/
|
||||
void resetSearchEngines();
|
||||
};
|
||||
|
@ -253,7 +253,7 @@ interface nsIBrowserSearchInitObserver : nsISupports
|
||||
void onInitComplete(in nsresult aStatus);
|
||||
};
|
||||
|
||||
[scriptable, uuid(a982859b-2852-466a-8ed1-9e714c0e65d1)]
|
||||
[scriptable, uuid(4a4ce87d-7cb9-4975-a267-345f6a49bb8f)]
|
||||
interface nsIBrowserSearchService : nsISupports
|
||||
{
|
||||
/**
|
||||
@ -281,11 +281,6 @@ interface nsIBrowserSearchService : nsISupports
|
||||
*/
|
||||
readonly attribute bool isInitialized;
|
||||
|
||||
/**
|
||||
* Resets the default engine to its original value.
|
||||
*/
|
||||
void resetToOriginalDefaultEngine();
|
||||
|
||||
/**
|
||||
* Adds a new search engine from the file at the supplied URI, optionally
|
||||
* asking the user for confirmation first. If a confirmation dialog is
|
||||
|
@ -274,7 +274,7 @@ proto.deepEqual = function deepEqual(actual, expected, message) {
|
||||
* (string) Short explanation of the expected result
|
||||
*/
|
||||
proto.notDeepEqual = function notDeepEqual(actual, expected, message) {
|
||||
this.report(ObjectUtils.deepEqual(actual, expected), actual, expected, message, "notDeepEqual");
|
||||
this.report(_deepEqual(actual, expected), actual, expected, message, "notDeepEqual");
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -3304,10 +3304,6 @@ SearchService.prototype = {
|
||||
return this.getEngineByName(defaultEngine);
|
||||
},
|
||||
|
||||
resetToOriginalDefaultEngine: function SRCH_SVC__resetToOriginalDefaultEngine() {
|
||||
this.defaultEngine = this._originalDefaultEngine;
|
||||
},
|
||||
|
||||
_buildCache: function SRCH_SVC__buildCache() {
|
||||
if (!getBoolPref(BROWSER_SEARCH_PREF + "cache.enabled", true))
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user