Revert "[layout test results.html] Small UI tweaks and tiny bug fixes"
This reverts commit 4e68cd40f4b4d77dc5fa187566b6e75ecb5bd483.
Reason for revert: Couple of outstanding bugs. Sorry I did not get
to code review this before landing.
Original change's description:
> [layout test results.html] Small UI tweaks and tiny bug fixes
>
> - When click the toolbar to select a view during animation, show the
> view for 1 second. This is convenient to briefly view a specific view
> without stopping the animation. Previously the time showing the clicked
> view was random.
>
> - Let GUI.getExpectation(el) handle cases that the el is under
> result-frame, so that keyboard navigation still works when the focus
> is under result-frame (e.g. after the toolbar or the image result is
> clicked).
>
> - Let GUI.activeExpectation() return the open expectation if no
> expectation line can be found from the focused element, so that keyboard
> navigation can be based on the open expectation if the focus is neither
> under the expectation line nor result-frame.
>
> - Correct total count. Previously the total count didn't include expected
> failures, skipped and wontfix tests, etc.
>
> Change-Id: Ibc4b697c52a7b5d37f0ebbfb5c925cc478f15f06
> Reviewed-on: https://chromium-review.googlesource.com/777469
> Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
> Reviewed-by: Quinten Yearsley <qyearsley@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#517674}
TBR=wangxianzhu@chromium.org,qyearsley@chromium.org,atotic@chromium.org
Change-Id: I214a79799ab0c5744c00c0cbd85f1ecd7978159f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/777808
Reviewed-by: Aleks Totic <atotic@chromium.org>
Commit-Queue: Aleks Totic <atotic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517725}diff --git a/third_party/WebKit/LayoutTests/fast/harness/results.html b/third_party/WebKit/LayoutTests/fast/harness/results.html
index de7bc98..92c6549 100644
--- a/third_party/WebKit/LayoutTests/fast/harness/results.html
+++ b/third_party/WebKit/LayoutTests/fast/harness/results.html
@@ -317,8 +317,7 @@
</div>
<div id="report_header" style="margin-top:8px">
- <span class="fix-width">Tests shown</span><span id="report_count"></span>
- <span id="report_title" style="font-weight:bold"></span>
+ <span class="fix-width">Tests shown</span><span id="report_title" style="font-weight:bold"></span>
in format:
<select id="report_format" onchange="Query.generateReport()">
<option value="plain" selected>Plain text</option>
@@ -826,7 +825,6 @@
};
window.setTimeout( _ => {
traversal.traverse(filter, report.print);
- document.querySelector("#report_count").innerText = traversal.html.length;
this.completeReportPromise(traversal);
this.currentRAF = window.requestAnimationFrame(callback);
}, 0);
@@ -1004,8 +1002,9 @@
showNextExpectation: function(backward) {
let nextExpectation;
+ let openDetails = document.querySelector(".details.open");
+ let openExpectation = openDetails && GUI.getExpectation(openDetails);
let activeExpectation = GUI.activeExpectation();
- let openExpectation = GUI.openExpectation();
if (openExpectation)
GUI.hideResults(openExpectation);
if (openExpectation && openExpectation == activeExpectation) {
@@ -1025,13 +1024,12 @@
}
},
- openExpectation: function() {
- let openDetails = document.querySelector(".details.open");
- return openDetails && GUI.getExpectation(openDetails);
- },
-
activeExpectation: function() {
- return GUI.getExpectation(document.activeElement) || GUI.openExpectation();
+ let result = GUI.closest(document.activeElement, "expect");
+ if (result)
+ return result;
+ result = GUI.closest(document.activeElement, "result-frame");
+ return result ? result.previousElementSibling : null;
},
initEvents: function() {
@@ -1125,6 +1123,7 @@
printSummary: function (fullResults) {
if (fullResults.builder_name)
document.querySelector("#builder_name").innerText = fullResults.builder_name;
+ document.querySelector("#summary_total").innerText = fullResults.num_passes + fullResults.num_regressions;
document.querySelector("#summary_passed").innerText = fullResults.num_passes;
document.querySelector("#summary_regressions").innerText = fullResults.num_regressions;
let failures = fullResults["num_failures_by_type"];
@@ -1142,12 +1141,10 @@
"count_unexpected_pass": 0,
"count_unexpected_fail": 0,
"count_testexpectations": 0,
- "count_flaky": 0,
- "count_all": 0,
+ "count_flaky": 0
};
var t = new Traversal(fullResults.tests);
t.traverse( test => {
- counts.count_all++;
if (Filters.unexpectedPass(test))
counts.count_unexpected_pass++;
if (Filters.unexpectedFailure(test))
@@ -1159,16 +1156,11 @@
});
for (let p in counts)
document.querySelector("#" + p).innerText = counts[p];
-
- document.querySelector("#summary_total").innerText = counts.count_all;
+ document.querySelector("#count_all").innerText = fullResults.num_passes + fullResults.num_regressions;
},
getExpectation: function(el) {
- let result = GUI.closest(el, "expect");
- if (result)
- return result;
- result = GUI.closest(document.activeElement, "result-frame");
- return result ? result.previousElementSibling : null;
+ return GUI.closest(el, "expect");
},
isFlag: function(el) {
@@ -1384,11 +1376,6 @@
if (ev.target.tagName == "A") {
this.selectAnchor(ev.target);
ev.preventDefault();
- if (this.animationIntervalId) {
- // Restart animation to show the clicked view for one second.
- this.setAnimation(false);
- window.setTimeout(_ => this.setAnimation(true), 1000);
- }
}
});