Backed out changeset dff900f56c49 (bug 987310) for orange in bc2 linux tests

This commit is contained in:
Carsten "Tomcat" Book
2014-03-26 15:45:17 +01:00
parent 52158be97b
commit f0025834f6
3 changed files with 12 additions and 61 deletions

View File

@@ -699,11 +699,6 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
* "flash" or "other".
*/
_enableFilter: function (aType) {
// Make sure this is a valid filter type.
if (Object.keys(this._allFilterPredicates).indexOf(aType) == -1) {
return;
}
// Add the filter to the list of active filters.
this._activeFilters.push(aType);
@@ -722,7 +717,18 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
* the active filters.
*/
get _filterPredicate() {
let filterPredicates = this._allFilterPredicates;
let filterPredicates = {
"all": () => true,
"html": this.isHtml,
"css": this.isCss,
"js": this.isJs,
"xhr": this.isXHR,
"fonts": this.isFont,
"images": this.isImage,
"media": this.isMedia,
"flash": this.isFlash,
"other": this.isOther
};
if (this._activeFilters.length === 1) {
// The simplest case: only one filter active.
@@ -737,22 +743,6 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
}
},
/**
* Returns an object with all the filter predicates as [key: function] pairs.
*/
get _allFilterPredicates() ({
all: () => true,
html: this.isHtml,
css: this.isCss,
js: this.isJs,
xhr: this.isXHR,
fonts: this.isFont,
images: this.isImage,
media: this.isMedia,
flash: this.isFlash,
other: this.isOther
}),
/**
* Sorts all network requests in this container by a specified detail.
*

View File

@@ -50,7 +50,6 @@ support-files =
[browser_net_filter-01.js]
[browser_net_filter-02.js]
[browser_net_filter-03.js]
[browser_net_filter-04.js]
[browser_net_footer-summary.js]
[browser_net_html-preview.js]
[browser_net_icon-preview.js]

View File

@@ -1,38 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests if invalid filter types are sanitized when loaded from the preferences.
*/
function test() {
Services.prefs.setCharPref("devtools.netmonitor.filters", '["js", "bogus"]');
initNetMonitor(FILTERING_URL).then(([aTab, aDebuggee, aMonitor]) => {
info("Starting test... ");
let { Prefs } = aMonitor.panelWin;
is(Prefs.filters.length, 2,
"All filter types were loaded as an array from the preferences.");
is(Prefs.filters[0], "js",
"The first filter type is correct.");
is(Prefs.filters[1], "bogus",
"The second filter type is invalid, but loaded anyway.");
waitForNetworkEvents(aMonitor, 7).then(() => {
testFilterButtons(aMonitor, "js");
ok(true, "Only the correct filter type was taken into consideration.");
teardown(aMonitor).then(() => {
let filters = Services.prefs.getCharPref("devtools.netmonitor.filters");
is(filters, '["js"]',
"The bogus filter type was ignored and removed from the preferences.");
finish();
});
});
aDebuggee.performRequests('{ "getMedia": true, "getFlash": true }');
});
}