Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(677)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector/network/network-filters.html

Issue 1992093002: [Devtools] Fixed regression with negative filters in networking (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector/network/network-filters-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/inspector/network/network-filters.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-filters.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-filters.html
new file mode 100644
index 0000000000000000000000000000000000000000..24f30ec939b876158cf562c553ad6217a8535d87
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-filters.html
@@ -0,0 +1,91 @@
+<html>
+<head>
+<script src="../inspector-test.js"></script>
+<script src="../network-test.js"></script>
+<script>
+function test()
+{
+ InspectorTest.recordNetwork();
+
+ var totalResourceCount = 3;
+ InspectorTest.makeFetch("resources/style.css", {}, ensureAllResources);
+ InspectorTest.makeFetch("resources/abe.png", {}, ensureAllResources);
+ InspectorTest.makeFetch("resources/abe.png", {}, ensureAllResources);
+ var filterChecks = [{
+ filterText: "-.css",
+ isRegex: false
+ }, {
+ filterText: "-.png",
+ isRegex: false
+ }, {
+ filterText: "css",
+ isRegex: false
+ }, {
+ filterText: "",
+ isRegex: false
+ }, {
+ filterText: ".*",
+ isRegex: true
+ }, {
+ filterText: ".*\\..*",
+ isRegex: true
+ }, {
+ filterText: ".*\\.png",
+ isRegex: true
+ }, {
+ filterText: "NOTHINGTOMATCH",
+ isRegex: true
+ }, {
+ filterText: "",
+ isRegex: true
+ }, {
+ filterText: "png",
+ isRegex: false
+ }];
+
+ var resourceCount = 0;
+ function ensureAllResources()
+ {
+ if (++resourceCount >= totalResourceCount)
+ checkFilters();
+ }
+
+ function checkFilters()
+ {
+ for (var filterObj of filterChecks) {
+ InspectorTest.addResult("filterText: " + filterObj.filterText);
+ InspectorTest.addResult("isRegex: " + filterObj.isRegex);
+
+ setNetworkLogFilter(filterObj.filterText, filterObj.isRegex);
+
+ var nodes = WebInspector.panels.network._networkLogView._nodesByRequestId.valuesArray();
+ var foundNodesCount = 0;
+ for (var i = 0; i < nodes.length; i++) {
+ if (!nodes[i][WebInspector.NetworkLogView._isFilteredOutSymbol])
+ foundNodesCount++;
+ }
+
+ InspectorTest.addResult("Found results: " + foundNodesCount);
+ InspectorTest.addResult("");
+ }
+ InspectorTest.completeTest();
+ }
+
+ /**
+ * @param {string} value
+ * @param {RegExp} isRegex
+ */
+ function setNetworkLogFilter(value, isRegex)
+ {
+ WebInspector.panels.network._networkLogView._textFilterUI._filterInputElement.value = value;
+ WebInspector.panels.network._networkLogView._textFilterUI._regexCheckBox.checked = isRegex;
+ WebInspector.panels.network._networkLogView._textFilterUI._valueChanged();
+ WebInspector.panels.network._networkLogView._filterChanged(null); // event not used in this method, so passing null
+ }
+}
+</script>
+</head>
+<body onload="runTest()">
+<p>Tests fetch network filters</p>
+</body>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector/network/network-filters-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698