Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Unified Diff: extensions/browser/api/system_cpu/system_cpu_apitest.cc

Issue 2802593005: extensions: Add CPU temperatures field to system.cpu.getInfo() function (Closed)
Patch Set: Respond to Devlin's comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: extensions/browser/api/system_cpu/system_cpu_apitest.cc
diff --git a/extensions/browser/api/system_cpu/system_cpu_apitest.cc b/extensions/browser/api/system_cpu/system_cpu_apitest.cc
index eabacff9393df97dbea45bf326e9ab95bf9df720..8e0bdef39ae14b58b9b8386a7e23939c1a880f1c 100644
--- a/extensions/browser/api/system_cpu/system_cpu_apitest.cc
+++ b/extensions/browser/api/system_cpu/system_cpu_apitest.cc
@@ -28,6 +28,12 @@ class MockCpuInfoProviderImpl : public CpuInfoProvider {
info_.processors[0].usage.user = 2;
info_.processors[0].usage.idle = 3;
info_.processors[0].usage.total = 6;
+
+ info_.temperatures.clear();
tbarzic 2017/04/27 17:50:19 info_.temperatures = {30.125, 40.0625};?
Simon Que 2017/04/27 17:59:54 Done.
+ // The fractional part of these values should be exactly represented as
+ // floating points to avoid rounding errors.
+ info_.temperatures.push_back(30.125);
+ info_.temperatures.push_back(40.0625);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698