Commit 34f8794c authored by Michael Checo's avatar Michael Checo Committed by Commit Bot

Diagnostics: Use data point in CPU card

Screenshots:
 - Diagnostics Page (before) http://shortn/_h8KubnXkcH
 - Diagnostics Page (after) http://shortn/_PLo7f0AOfM

Bug: 1125150
Test: browser_tests --gtest_filter=DiagnosticsApp*
Change-Id: I40c8d6cccc9e42457047f9dd79f74ab568e91596
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2426967
Commit-Queue: Michael Checo <michaelcheco@google.com>
Reviewed-by: default avatarZentaro Kavanagh <zentaro@chromium.org>
Cr-Commit-Position: refs/heads/master@{#811022}
parent b089fb66
...@@ -214,15 +214,13 @@ suite('CpuCardTest', () => { ...@@ -214,15 +214,13 @@ suite('CpuCardTest', () => {
test('CpuCardPopulated', () => { test('CpuCardPopulated', () => {
return initializeCpuCard(fakeCpuUsage).then(() => { return initializeCpuCard(fakeCpuUsage).then(() => {
const dataPoints =
diagnostics_test_utils.getDataPointElements(cpuElement);
assertEquals( assertEquals(
fakeCpuUsage[0].cpu_temp_degrees_celcius.toString(), fakeCpuUsage[0].cpu_temp_degrees_celcius, dataPoints[0].value);
cpuElement.$$('#cpuTemp').textContent); assertEquals(fakeCpuUsage[0].percent_usage_user, dataPoints[1].value);
assertEquals( assertEquals(fakeCpuUsage[0].percent_usage_system, dataPoints[2].value);
fakeCpuUsage[0].percent_usage_user.toString(),
cpuElement.$$('#cpuUsageUser').textContent);
assertEquals(
fakeCpuUsage[0].percent_usage_system.toString(),
cpuElement.$$('#cpuUsageSystem').textContent);
}); });
}); });
}); });
......
...@@ -34,6 +34,7 @@ js_library("battery_status_card") { ...@@ -34,6 +34,7 @@ js_library("battery_status_card") {
js_library("cpu_card") { js_library("cpu_card") {
deps = [ deps = [
":data_point",
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
] ]
} }
......
<style include="diagnostics-shared"> <style include="diagnostics-shared diagnostics-fonts">
</style> </style>
<diagnostics-card> <diagnostics-card>
...@@ -6,9 +6,13 @@ ...@@ -6,9 +6,13 @@
<!-- TODO(zentaro) Localize once strings are confirmed --> <!-- TODO(zentaro) Localize once strings are confirmed -->
<div id="cardTitle">CPU</div> <div id="cardTitle">CPU</div>
</div> </div>
<div slot="body"> <data-point slot="body" id="cpuTemp"
<div id="cpuTemp">[[cpuUsage_.cpu_temp_degrees_celcius]]</div> value="[[cpuUsage_.cpu_temp_degrees_celcius]]">
<div id="cpuUsageUser">[[cpuUsage_.percent_usage_user]]</div> </data-point>
<div id="cpuUsageSystem">[[cpuUsage_.percent_usage_system]]</div> <data-point slot="body" id="cpuUsageUser"
</div> value="[[cpuUsage_.percent_usage_user]]">
</data-point>
<data-point slot="body" id="cpuUsageSystem"
value="[[cpuUsage_.percent_usage_system]]">
</data-point>
</diagnostics-card> </diagnostics-card>
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
import './data_point.js';
import './diagnostics_card.js'; import './diagnostics_card.js';
import './diagnostics_shared_css.js'; import './diagnostics_shared_css.js';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment