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

Unified Diff: chromeos/system/fake_statistics_provider.h

Issue 598023006: Add browser test for initial languages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update after review. Created 6 years, 2 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: chromeos/system/fake_statistics_provider.h
diff --git a/chromeos/system/fake_statistics_provider.h b/chromeos/system/fake_statistics_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..8d9cd8423cf8c4cde6c98e60cda14f3456e56b48
--- /dev/null
+++ b/chromeos/system/fake_statistics_provider.h
@@ -0,0 +1,46 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMEOS_SYSTEM_FAKE_STATISTICS_PROVIDER_H_
+#define CHROMEOS_SYSTEM_FAKE_STATISTICS_PROVIDER_H_
+
+#include "base/basictypes.h"
+#include "chromeos/system/statistics_provider.h"
+
+namespace chromeos {
+namespace system {
+
+// Custom StatisticsProvider that will return each set of region settings.
+class FakeStatisticsProvider : public StatisticsProvider {
+ public:
+ virtual ~FakeStatisticsProvider() {}
Dmitry Polukhin 2014/10/03 07:49:52 Missing OVERRIDE.
Alexander Alekseev 2014/10/03 12:59:17 Done.
+
+ void set_locale(const std::string& locale) { initial_locale_ = locale; }
+
+ void set_keyboard_layout(const std::string& keyboard_layout) {
+ keyboard_layout_ = keyboard_layout;
+ }
+
+ private:
+ // StatisticsProvider overrides.
+ virtual void StartLoadingMachineStatistics(
+ const scoped_refptr<base::TaskRunner>& file_task_runner,
+ bool load_oem_manifest) OVERRIDE;
+
+ // Populates the named machine statistic for initial_locale and
+ // keyboard_layout only.
+ virtual bool GetMachineStatistic(const std::string& name,
+ std::string* result) OVERRIDE;
+
+ virtual bool GetMachineFlag(const std::string& name, bool* result) OVERRIDE;
+ virtual void Shutdown() OVERRIDE;
+
+ std::string initial_locale_;
+ std::string keyboard_layout_;
+};
+
+} // namespace system
+} // namespace chromeos
+
+#endif // CHROMEOS_SYSTEM_FAKE_STATISTICS_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698