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

Side by Side Diff: chrome/test/data/extensions/api_test/systeminfo/cpu/test_cpu_api.js

Issue 15817008: Move systemInfo.cpu API out out experimental namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add new enum values rather than renaming existing ones Created 7 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // systeminfo.cpu api test 5 // systeminfo.cpu api test
6 // browser_tests.exe --gtest_filter=SystemInfoCpuApiTest.* 6 // browser_tests.exe --gtest_filter=SystemInfoCpuApiTest.*
7 7
8 chrome.systemInfo = chrome.experimental.systemInfo;
9
10 var userStep = 3; 8 var userStep = 3;
11 var kernelStep = 2; 9 var kernelStep = 2;
12 var idleStep = 1; 10 var idleStep = 1;
13 function calculateUsage(count) { 11 function calculateUsage(count) {
14 return (100 - idleStep * 100/(userStep + kernelStep + idleStep)); 12 return (100 - idleStep * 100/(userStep + kernelStep + idleStep));
15 } 13 }
16 14
17 chrome.test.runTests([ 15 chrome.test.runTests([
18 function testGet() { 16 function testGet() {
19 for(var i = 0; i < 20; ++i) { 17 for(var i = 0; i < 20; ++i) {
(...skipping 15 matching lines...) Expand all
35 33
36 chrome.test.assertEq(updateInfo.usagePerProcessor.length, 4); 34 chrome.test.assertEq(updateInfo.usagePerProcessor.length, 4);
37 for (var i = 0; i < updateInfo.usagePerProcessor.length; ++i) 35 for (var i = 0; i < updateInfo.usagePerProcessor.length; ++i)
38 chrome.test.assertEq(updateInfo.usagePerProcessor[i], expectedUsage); 36 chrome.test.assertEq(updateInfo.usagePerProcessor[i], expectedUsage);
39 if (++numOfUpdatedEvent > 5) 37 if (++numOfUpdatedEvent > 5)
40 doneUpdatedEvent(); 38 doneUpdatedEvent();
41 }); 39 });
42 } 40 }
43 ]); 41 ]);
44 42
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/systeminfo/cpu/manifest.json ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698