Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: chrome/content/tests/performance/matching.html

Issue 29321487: Issue 2738 - Fix tests to pass type bit mask to matching functions (Closed)
Patch Set: Created July 9, 2015, 1:46 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/content/tests/matcher.js ('k') | chrome/content/tests/regexpFilters_matching.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Filter matching performance measurements</title> 4 <title>Filter matching performance measurements</title>
5 <script type="application/x-javascript;version=1.7" src="common.js"></script> 5 <script type="application/x-javascript;version=1.7" src="common.js"></script>
6 <script type="application/x-javascript;version=1.7" src="../common.js"></scrip t> 6 <script type="application/x-javascript;version=1.7" src="../common.js"></scrip t>
7 </head> 7 </head>
8 <body> 8 <body>
9 <p> 9 <p>
10 Filters to be used:<br> 10 Filters to be used:<br>
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 defaultMatcher.clear(); 61 defaultMatcher.clear();
62 for (let filter of filters) 62 for (let filter of filters)
63 defaultMatcher.add(filter); 63 defaultMatcher.add(filter);
64 64
65 runTests(runTest, cleanup, finalize); 65 runTests(runTest, cleanup, finalize);
66 } 66 }
67 67
68 function runTest() 68 function runTest()
69 { 69 {
70 for (let address of addresses) 70 for (let address of addresses)
71 defaultMatcher.matchesAny(address, "IMAGE", null, false); 71 defaultMatcher.matchesAny(address, RegExpFilter.toTypeMask("IMAGE"), nul l, false);
72 } 72 }
73 73
74 function cleanup() 74 function cleanup()
75 { 75 {
76 // Add and remove a dummy filter to clear matcher's cache 76 // Add and remove a dummy filter to clear matcher's cache
77 let dummy = Filter.fromText("foobar"); 77 let dummy = Filter.fromText("foobar");
78 defaultMatcher.add(dummy); 78 defaultMatcher.add(dummy);
79 defaultMatcher.remove(dummy); 79 defaultMatcher.remove(dummy);
80 } 80 }
81 81
82 function finalize() 82 function finalize()
83 { 83 {
84 document.getElementById("progress").style.display = "none"; 84 document.getElementById("progress").style.display = "none";
85 document.getElementById("filters").disabled = false; 85 document.getElementById("filters").disabled = false;
86 document.getElementById("addresses").disabled = false; 86 document.getElementById("addresses").disabled = false;
87 document.getElementById("startButton").disabled = false; 87 document.getElementById("startButton").disabled = false;
88 filters = null; 88 filters = null;
89 addresses = null; 89 addresses = null;
90 } 90 }
91 </script> 91 </script>
92 </body> 92 </body>
93 </html> 93 </html>
OLDNEW
« no previous file with comments | « chrome/content/tests/matcher.js ('k') | chrome/content/tests/regexpFilters_matching.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld