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

Unified Diff: base/prefs/pref_service_unittest.cc

Issue 1544033003: Switch to standard integer types in base/prefs/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « base/prefs/pref_service_factory.h ('k') | base/prefs/pref_store.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/prefs/pref_service_unittest.cc
diff --git a/base/prefs/pref_service_unittest.cc b/base/prefs/pref_service_unittest.cc
index 2506b1d3f5722cb4db31fd8d316a01284717cabc..649c35fcf7fe9657d78743f013f30d3fb20e9ec6 100644
--- a/base/prefs/pref_service_unittest.cc
+++ b/base/prefs/pref_service_unittest.cc
@@ -2,8 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <stddef.h>
+#include <stdint.h>
+
#include <string>
+#include "base/macros.h"
#include "base/prefs/json_pref_store.h"
#include "base/prefs/mock_pref_change_callback.h"
#include "base/prefs/pref_change_registrar.h"
@@ -234,29 +238,29 @@ class WriteFlagChecker : public TestingPrefStore {
public:
WriteFlagChecker() {}
- void ReportValueChanged(const std::string& key, uint32 flags) override {
+ void ReportValueChanged(const std::string& key, uint32_t flags) override {
SetLastWriteFlags(flags);
}
void SetValue(const std::string& key,
scoped_ptr<base::Value> value,
- uint32 flags) override {
+ uint32_t flags) override {
SetLastWriteFlags(flags);
}
void SetValueSilently(const std::string& key,
scoped_ptr<base::Value> value,
- uint32 flags) override {
+ uint32_t flags) override {
SetLastWriteFlags(flags);
}
- void RemoveValue(const std::string& key, uint32 flags) override {
+ void RemoveValue(const std::string& key, uint32_t flags) override {
SetLastWriteFlags(flags);
}
- uint32 GetLastFlagsAndClear() {
+ uint32_t GetLastFlagsAndClear() {
CHECK(last_write_flags_set_);
- uint32 result = last_write_flags_;
+ uint32_t result = last_write_flags_;
last_write_flags_set_ = false;
last_write_flags_ = WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS;
return result;
@@ -267,14 +271,14 @@ class WriteFlagChecker : public TestingPrefStore {
private:
~WriteFlagChecker() override {}
- void SetLastWriteFlags(uint32 flags) {
+ void SetLastWriteFlags(uint32_t flags) {
CHECK(!last_write_flags_set_);
last_write_flags_set_ = true;
last_write_flags_ = flags;
}
bool last_write_flags_set_ = false;
- uint32 last_write_flags_ = WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS;
+ uint32_t last_write_flags_ = WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS;
};
TEST(PrefServiceTest, WriteablePrefStoreFlags) {
@@ -286,14 +290,14 @@ TEST(PrefServiceTest, WriteablePrefStoreFlags) {
// The first 8 bits of write flags are reserved for subclasses. Create a
// custom flag in this range
- uint32 kCustomRegistrationFlag = 1 << 2;
+ uint32_t kCustomRegistrationFlag = 1 << 2;
// A map of the registration flags that will be tested and the write flags
// they are expected to convert to.
struct RegistrationToWriteFlags {
const char* pref_name;
- uint32 registration_flags;
- uint32 write_flags;
+ uint32_t registration_flags;
+ uint32_t write_flags;
};
const RegistrationToWriteFlags kRegistrationToWriteFlags[] = {
{"none",
« no previous file with comments | « base/prefs/pref_service_factory.h ('k') | base/prefs/pref_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698