Analysis task page shows an empty results for an irrelevant top-level test
[WebKit-https.git] / Websites / perf.webkit.org / public / v3 / components / test-group-results-viewer.js
index 10be0f2..20c9607 100644 (file)
@@ -24,6 +24,12 @@ class TestGroupResultsViewer extends ComponentBase {
     {
         this._analysisResults = analysisResults;
         this._currentMetric = metric;
+        if (metric) {
+            const path = metric.test().path();
+            for (let i = path.length - 2; i >= 0; i--)
+                this._expandedTests.add(path[i]);
+        }
+
         this.enqueueToRender();
     }
 
@@ -32,8 +38,8 @@ class TestGroupResultsViewer extends ComponentBase {
         if (!this._testGroup || !this._analysisResults)
             return;
 
-        this._renderResultsTableLazily.evaluate(this._testGroup, this._expandedTests, ...this._analysisResults.highestTests());
-        this._renderCurrentMetricsLazily.evaluate(this._currentMetric);
+        this._renderResultsTableLazily.evaluate(this._testGroup, this._expandedTests,
+            ...this._analysisResults.topLevelTestsForTestGroup(this._testGroup));
     }
 
     _renderResultsTable(testGroup, expandedTests, ...tests)
@@ -58,6 +64,9 @@ class TestGroupResultsViewer extends ComponentBase {
 
     _buildRowsForTest(testGroup, expandedTests, test, sharedPath, maxDepth, depth)
     {
+        if (!this._analysisResults.containsTest(test))
+            return [];
+
         const element = ComponentBase.createElement;
         const rows = element('tbody', test.metrics().map((metric) => this._buildRowForMetric(testGroup, metric, sharedPath, maxDepth, depth)));