diff options
Diffstat (limited to 'chromium/third_party/catapult/tracing/tracing/base/unittest/html_test_results.html')
-rw-r--r-- | chromium/third_party/catapult/tracing/tracing/base/unittest/html_test_results.html | 77 |
1 files changed, 43 insertions, 34 deletions
diff --git a/chromium/third_party/catapult/tracing/tracing/base/unittest/html_test_results.html b/chromium/third_party/catapult/tracing/tracing/base/unittest/html_test_results.html index fa65a9e88fb..d648fff082d 100644 --- a/chromium/third_party/catapult/tracing/tracing/base/unittest/html_test_results.html +++ b/chromium/third_party/catapult/tracing/tracing/base/unittest/html_test_results.html @@ -116,10 +116,10 @@ tr.exportTo('tr.b.unittest', function() { var HTMLTestCaseResult = tr.ui.b.define('x-html-test-case-result'); HTMLTestCaseResult.prototype = { - __proto__: HTMLUnknownElement.prototype, + __proto__: HTMLDivElement.prototype, decorate: function() { - this.appendChild(tr.ui.b.instantiateTemplate( + Polymer.dom(this).appendChild(tr.ui.b.instantiateTemplate( '#x-html-test-case-result-template', THIS_DOC)); this.testCase_ = undefined; this.testCaseHRef_ = undefined; @@ -157,61 +157,68 @@ tr.exportTo('tr.b.unittest', function() { this.updateTitle_(); }, updateTitle_: function() { - var titleEl = this.querySelector('#title'); + var titleEl = Polymer.dom(this).querySelector('#title'); if (this.testCase_ === undefined) { - titleEl.textContent = ''; + Polymer.dom(titleEl).textContent = ''; return; } if (this.testCaseHRef_) { - titleEl.innerHTML = '<a href="' + this.testCaseHRef_ + '">' + + Polymer.dom(titleEl).innerHTML = + '<a href="' + this.testCaseHRef_ + '">' + this.testCase_.fullyQualifiedName + '</a>'; } else { - titleEl.textContent = this.testCase_.fullyQualifiedName; + Polymer.dom(titleEl).textContent = this.testCase_.fullyQualifiedName; } }, addError: function(normalizedException) { var errorEl = document.createElement('x-html-test-case-error'); - errorEl.appendChild(tr.ui.b.instantiateTemplate( + Polymer.dom(errorEl).appendChild(tr.ui.b.instantiateTemplate( '#x-html-test-case-error-template', THIS_DOC)); - errorEl.querySelector('#stack').textContent = normalizedException.stack; - this.querySelector('#details').appendChild(errorEl); + Polymer.dom(Polymer.dom(errorEl).querySelector('#stack')). + textContent = normalizedException.stack; + Polymer.dom(Polymer.dom(this).querySelector('#details')).appendChild( + errorEl); this.updateColorAndStatus_(); }, addFlaky: function() { var flakyEl = document.createElement('x-html-test-case-flaky'); - flakyEl.appendChild(tr.ui.b.instantiateTemplate( + Polymer.dom(flakyEl).appendChild(tr.ui.b.instantiateTemplate( '#x-html-test-case-flaky-template', THIS_DOC)); - flakyEl.querySelector('#message').textContent = 'FLAKY'; - this.querySelector('#details').appendChild(flakyEl); + Polymer.dom(Polymer.dom(flakyEl).querySelector('#message')) + .textContent = 'FLAKY'; + Polymer.dom(Polymer.dom(this).querySelector('#details')).appendChild( + flakyEl); this.updateColorAndStatus_(); }, addHTMLOutput: function(element) { var htmlResultEl = document.createElement('x-html-test-case-html-result'); - htmlResultEl.appendChild(element); - this.querySelector('#details').appendChild(htmlResultEl); + Polymer.dom(htmlResultEl).appendChild(element); + Polymer.dom(Polymer.dom(this).querySelector('#details')) + .appendChild(htmlResultEl); }, updateHTMLOutputDisplayState_: function() { - var htmlResults = this.querySelectorAll('x-html-test-case-html-result'); + var htmlResults = + Polymer.dom(this).querySelectorAll('x-html-test-case-html-result'); var display; if (this.showHTMLOutput) display = ''; else - display = (this.testStatus_ == TestStatus.RUNNING) ? '' : 'none'; + display = (this.testStatus_ === TestStatus.RUNNING) ? '' : 'none'; for (var i = 0; i < htmlResults.length; i++) htmlResults[i].style.display = display; }, get hadErrors() { - return !!this.querySelector('x-html-test-case-error'); + return !!Polymer.dom(this).querySelector('x-html-test-case-error'); }, get isFlaky() { - return !!this.querySelector('x-html-test-case-flaky'); + return !!Polymer.dom(this).querySelector('x-html-test-case-flaky'); }, get duration() { @@ -242,10 +249,10 @@ tr.exportTo('tr.b.unittest', function() { } else if (this.isFlaky) { colorCls = 'unittest-flaky'; status = 'flaky'; - } else if (this.testStatus_ == TestStatus.PENDING) { + } else if (this.testStatus_ === TestStatus.PENDING) { colorCls = 'unittest-pending'; status = 'pending'; - } else if (this.testStatus_ == TestStatus.RUNNING) { + } else if (this.testStatus_ === TestStatus.RUNNING) { colorCls = 'unittest-running'; status = 'running'; } else { // DONE_RUNNING and no errors @@ -253,12 +260,12 @@ tr.exportTo('tr.b.unittest', function() { status = 'passed'; } - var statusEl = this.querySelector('#status'); + var statusEl = Polymer.dom(this).querySelector('#status'); if (this.duration_) - statusEl.textContent = status + ' (' + + Polymer.dom(statusEl).textContent = status + ' (' + this.duration_.toFixed(2) + 'ms)'; else - statusEl.textContent = status; + Polymer.dom(statusEl).textContent = status; statusEl.className = colorCls; }, @@ -268,7 +275,8 @@ tr.exportTo('tr.b.unittest', function() { set testReturnValue(testReturnValue) { this.testReturnValue_ = testReturnValue; - this.querySelector('#return-value').textContent = testReturnValue; + Polymer.dom(Polymer.dom(this).querySelector('#return-value')) + .textContent = testReturnValue; } }; @@ -315,7 +323,8 @@ tr.exportTo('tr.b.unittest', function() { set showHTMLOutput(showHTMLOutput) { this.showHTMLOutput_ = showHTMLOutput; - var testCaseResults = this.querySelectorAll('x-html-test-case-result'); + var testCaseResults = + Polymer.dom(this).querySelectorAll('x-html-test-case-result'); for (var i = 0; i < testCaseResults.length; i++) testCaseResults[i].showHTMLOutput = showHTMLOutput; }, @@ -327,7 +336,8 @@ tr.exportTo('tr.b.unittest', function() { set showPendingAndPassedTests(showPendingAndPassedTests) { this.showPendingAndPassedTests_ = showPendingAndPassedTests; - var testCaseResults = this.querySelectorAll('x-html-test-case-result'); + var testCaseResults = + Polymer.dom(this).querySelectorAll('x-html-test-case-result'); for (var i = testCaseResults.length - 1; i >= 0; i--) this.updateDisplayStateForResult_(testCaseResults[i]); }, @@ -335,7 +345,7 @@ tr.exportTo('tr.b.unittest', function() { updateDisplayStateForResult_: function(res) { var display; if (this.showPendingAndPassedTests_) { - if (res.testStatus == TestStatus.RUNNING || + if (res.testStatus === TestStatus.RUNNING || res.hadErrors) { display = ''; } else { @@ -354,14 +364,14 @@ tr.exportTo('tr.b.unittest', function() { testCaseResult.showHTMLOutput = this.showHTMLOutput_; testCaseResult.testCase = testCase; if ((i % 2) === 0) - testCaseResult.classList.add('dark'); + Polymer.dom(testCaseResult).classList.add('dark'); var href = this.getHRefForTestCase(testCase); if (href) testCaseResult.testCaseHRef = href; testCaseResult.testStatus = TestStatus.PENDING; this.testCaseResultsByCaseGUID_[testCase.guid] = testCaseResult; - this.appendChild(testCaseResult); + Polymer.dom(this).appendChild(testCaseResult); this.updateDisplayStateForResult_(testCaseResult); }, this); }, @@ -447,19 +457,19 @@ tr.exportTo('tr.b.unittest', function() { }; }, - notifyTestResultToDevServer_: function(result, extra_msg) { + notifyTestResultToDevServer_: function(result, extraMsg) { var req = new XMLHttpRequest(); var testName = this.currentTestCaseResult_.testCase.fullyQualifiedName; - var data = result + ' ' + testName + ' ' + (extra_msg || ''); + var data = result + ' ' + testName + ' ' + (extraMsg || ''); tr.b.postAsync('/tracing/notify_test_result', data); }, notifyTestCompletionToDevServer_: function() { if (this.numTestsThatPassed_ + this.numTestsThatFailed_ + - this.numFlakyTests_ == 0) { + this.numFlakyTests_ === 0) { return; } - var data = this.numTestsThatFailed_ == 0 ? 'ALL_PASSED' : 'HAD_FAILURES'; + var data = this.numTestsThatFailed_ === 0 ? 'ALL_PASSED' : 'HAD_FAILURES'; data += '\nPassed tests: ' + this.numTestsThatPassed_ + ' Failed tests: ' + this.numTestsThatFailed_ + ' Flaky tests: ' + this.numFlakyTests_; @@ -468,7 +478,6 @@ tr.exportTo('tr.b.unittest', function() { }, log_: function(msg) { - //this.textContent += msg; tr.b.dispatchSimpleEvent(this, 'statschange'); } }; |