| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // CpuInfoProvider unit tests | 5 // CpuInfoProvider unit tests |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "chrome/browser/extensions/api/system_info_cpu/cpu_info_provider.h" | 9 #include "chrome/browser/extensions/api/system_info_cpu/cpu_info_provider.h" |
| 10 #include "content/public/test/test_browser_thread.h" | 10 #include "content/public/test/test_browser_thread.h" |
| 11 #include "content/public/test/test_utils.h" | 11 #include "content/public/test/test_utils.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 namespace extensions { | 14 namespace extensions { |
| 15 | 15 |
| 16 using api::experimental_system_info_cpu::CpuInfo; | 16 using api::system_info_cpu::CpuInfo; |
| 17 using api::experimental_system_info_cpu::CpuUpdateInfo; | 17 using api::system_info_cpu::CpuUpdateInfo; |
| 18 using content::BrowserThread; | 18 using content::BrowserThread; |
| 19 | 19 |
| 20 struct TestCpuInfo { | 20 struct TestCpuInfo { |
| 21 std::string arch_name; | 21 std::string arch_name; |
| 22 std::string model_name; | 22 std::string model_name; |
| 23 int num_of_processors; | 23 int num_of_processors; |
| 24 }; | 24 }; |
| 25 | 25 |
| 26 struct TestCpuTimeInfo { | 26 struct TestCpuTimeInfo { |
| 27 int64 user; | 27 int64 user; |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 base::Bind(&CpuInfoProviderTest::OnCheckCpuSamplingFinishedForTesting, | 273 base::Bind(&CpuInfoProviderTest::OnCheckCpuSamplingFinishedForTesting, |
| 274 base::Unretained(this))); | 274 base::Unretained(this))); |
| 275 content::RunAllPendingInMessageLoop(content::BrowserThread::FILE); | 275 content::RunAllPendingInMessageLoop(content::BrowserThread::FILE); |
| 276 content::RunMessageLoop(); | 276 content::RunMessageLoop(); |
| 277 cpu_info_provider_->StopSampling(); | 277 cpu_info_provider_->StopSampling(); |
| 278 content::RunAllPendingInMessageLoop(content::BrowserThread::FILE); | 278 content::RunAllPendingInMessageLoop(content::BrowserThread::FILE); |
| 279 VerifyResult(); | 279 VerifyResult(); |
| 280 } | 280 } |
| 281 | 281 |
| 282 } | 282 } |
| OLD | NEW |