Title: [232547] trunk/PerformanceTests
- Revision
- 232547
- Author
- [email protected]
- Date
- 2018-06-06 10:40:42 -0700 (Wed, 06 Jun 2018)
Log Message
Strip out more characters when creating permalinks
https://bugs.webkit.org/show_bug.cgi?id=186259
Reviewed by Said Abou-Hallawa.
Tests and suites may have names that make permalinks to the tests less readable when
shared. Expand the set of characters that are stripped out of the names.
* MotionMark/resources/debug-runner/motionmark.js: Refactor to call
stripUnwantedCharactersForURL. For existing links, decode the suite and test names.
* MotionMark/resources/extensions.js:
(Utilities.stripUnwantedCharactersForURL): Rename from stripNonASCIICharacters.
Remove any non-alphanumeric character.
Modified Paths
Diff
Modified: trunk/PerformanceTests/ChangeLog (232546 => 232547)
--- trunk/PerformanceTests/ChangeLog 2018-06-06 16:42:05 UTC (rev 232546)
+++ trunk/PerformanceTests/ChangeLog 2018-06-06 17:40:42 UTC (rev 232547)
@@ -1,3 +1,19 @@
+2018-06-06 Jon Lee <[email protected]>
+
+ Strip out more characters when creating permalinks
+ https://bugs.webkit.org/show_bug.cgi?id=186259
+
+ Reviewed by Said Abou-Hallawa.
+
+ Tests and suites may have names that make permalinks to the tests less readable when
+ shared. Expand the set of characters that are stripped out of the names.
+
+ * MotionMark/resources/debug-runner/motionmark.js: Refactor to call
+ stripUnwantedCharactersForURL. For existing links, decode the suite and test names.
+ * MotionMark/resources/extensions.js:
+ (Utilities.stripUnwantedCharactersForURL): Rename from stripNonASCIICharacters.
+ Remove any non-alphanumeric character.
+
2018-06-04 Jon Lee <[email protected]>
Remove unnecessary MotionMark controllers
Modified: trunk/PerformanceTests/MotionMark/resources/debug-runner/motionmark.js (232546 => 232547)
--- trunk/PerformanceTests/MotionMark/resources/debug-runner/motionmark.js 2018-06-06 16:42:05 UTC (rev 232546)
+++ trunk/PerformanceTests/MotionMark/resources/debug-runner/motionmark.js 2018-06-06 17:40:42 UTC (rev 232547)
@@ -360,7 +360,7 @@
var link = Utilities.createElement("span", {}, testElement);
link.classList.add("link");
link.textContent = "link";
- link.suiteName = Utilities.stripNonASCIICharacters(suiteCheckbox.suite.name);
+ link.suiteName = Utilities.stripUnwantedCharactersForURL(suiteCheckbox.suite.name);
link.testName = test.name;
link._onclick_ = function(event) {
var element = event.target;
@@ -369,7 +369,7 @@
var options = optionsManager.updateLocalStorageFromUI();
Utilities.extendObject(options, {
"suite-name": element.suiteName,
- "test-name": Utilities.stripNonASCIICharacters(element.testName)
+ "test-name": Utilities.stripUnwantedCharactersForURL(element.testName)
});
var complexity = suitesManager._editElement(element.parentNode).value;
if (complexity)
@@ -481,6 +481,9 @@
suitesFromQueryString: function(suiteName, testName)
{
+ suiteName = decodeURIComponent(suiteName);
+ testName = decodeURIComponent(testName);
+
var suites = [];
var suiteRegExp = new RegExp(suiteName, "i");
var testRegExp = new RegExp(testName, "i");
@@ -487,13 +490,13 @@
for (var i = 0; i < Suites.length; ++i) {
var suite = Suites[i];
- if (!Utilities.stripNonASCIICharacters(suite.name).match(suiteRegExp))
+ if (!Utilities.stripUnwantedCharactersForURL(suite.name).match(suiteRegExp))
continue;
var test;
for (var j = 0; j < suite.tests.length; ++j) {
suiteTest = suite.tests[j];
- if (Utilities.stripNonASCIICharacters(suiteTest.name).match(testRegExp)) {
+ if (Utilities.stripUnwantedCharactersForURL(suiteTest.name).match(testRegExp)) {
test = suiteTest;
break;
}
Modified: trunk/PerformanceTests/MotionMark/resources/extensions.js (232546 => 232547)
--- trunk/PerformanceTests/MotionMark/resources/extensions.js 2018-06-06 16:42:05 UTC (rev 232546)
+++ trunk/PerformanceTests/MotionMark/resources/extensions.js 2018-06-06 17:40:42 UTC (rev 232547)
@@ -147,9 +147,9 @@
element.style[property] = element.style[this.browserPrefix().js + property[0].toUpperCase() + property.substr(1)] = value;
},
- stripNonASCIICharacters: function(inputString)
+ stripUnwantedCharactersForURL: function(inputString)
{
- return inputString.replace(/[ .,]/g, '');
+ return inputString.replace(/\W/g, '');
},
convertObjectToQueryString: function(object)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes