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

Unified Diff: chrome/browser/ui/webui/chromeos/login/l10n_util_unittest.cc

Issue 2958353002: [Cleanup] Migrate the StatisticsProvider to use the TaskScheduler (Closed)
Patch Set: rewrap a line Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/metrics/chromeos_metrics_provider.cc ('k') | chromeos/system/fake_statistics_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/chromeos/login/l10n_util_unittest.cc
diff --git a/chrome/browser/ui/webui/chromeos/login/l10n_util_unittest.cc b/chrome/browser/ui/webui/chromeos/login/l10n_util_unittest.cc
index 8202c1f1c912e17ff7738626bc56aacc4d3a55d5..d4c6b8a67da57c6548b4df2d3d4815449a6638c6 100644
--- a/chrome/browser/ui/webui/chromeos/login/l10n_util_unittest.cc
+++ b/chrome/browser/ui/webui/chromeos/login/l10n_util_unittest.cc
@@ -8,14 +8,11 @@
#include <utility>
-#include "base/at_exit.h"
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
-#include "base/memory/singleton.h"
-#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
-#include "base/single_thread_task_runner.h"
+#include "base/test/scoped_task_environment.h"
#include "base/values.h"
#include "chrome/browser/chromeos/customization/customization_document.h"
#include "chrome/browser/chromeos/input_method/input_method_configuration.h"
@@ -28,28 +25,6 @@ namespace chromeos {
namespace {
-class MachineStatisticsInitializer {
- public:
- MachineStatisticsInitializer();
-
- static MachineStatisticsInitializer* GetInstance();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(MachineStatisticsInitializer);
-};
-
-MachineStatisticsInitializer::MachineStatisticsInitializer() {
- base::MessageLoop loop;
- chromeos::system::StatisticsProvider::GetInstance()
- ->StartLoadingMachineStatistics(loop.task_runner(), false);
- base::RunLoop().RunUntilIdle();
-}
-
-// static
-MachineStatisticsInitializer* MachineStatisticsInitializer::GetInstance() {
- return base::Singleton<MachineStatisticsInitializer>::get();
-}
-
void VerifyOnlyUILanguages(const base::ListValue& list) {
for (size_t i = 0; i < list.GetSize(); ++i) {
const base::DictionaryValue* dict;
@@ -80,34 +55,27 @@ class L10nUtilTest : public testing::Test {
L10nUtilTest();
~L10nUtilTest() override;
- // testing::Test:
- void SetUp() override;
- void TearDown() override;
-
void SetInputMethods1();
void SetInputMethods2();
private:
- base::ShadowingAtExitManager at_exit_manager_;
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
MockInputMethodManagerWithInputMethods* input_manager_;
};
L10nUtilTest::L10nUtilTest()
: input_manager_(new MockInputMethodManagerWithInputMethods) {
-}
-
-L10nUtilTest::~L10nUtilTest() {
-}
-
-void L10nUtilTest::SetUp() {
chromeos::input_method::InitializeForTesting(input_manager_);
input_manager_->SetComponentExtensionIMEManager(
base::MakeUnique<ComponentExtensionIMEManager>());
- MachineStatisticsInitializer::GetInstance(); // Ignore result.
+
+ chromeos::system::StatisticsProvider::GetInstance()
+ ->StartLoadingMachineStatistics(false);
+ base::RunLoop().RunUntilIdle();
}
-void L10nUtilTest::TearDown() {
+L10nUtilTest::~L10nUtilTest() {
chromeos::input_method::Shutdown();
}
« no previous file with comments | « chrome/browser/metrics/chromeos_metrics_provider.cc ('k') | chromeos/system/fake_statistics_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698