summaryrefslogtreecommitdiffstats
path: root/chrome/test/sync
diff options
context:
space:
mode:
authormunjal@chromium.org <munjal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-04 18:33:53 +0000
committermunjal@chromium.org <munjal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-04 18:33:53 +0000
commit055aedeb2134e49c10c3b3a3593cb8df768d737c (patch)
tree4961da84e3e38e7c6a3edb68bb96e031f8856604 /chrome/test/sync
parent46e9f9d97ec029189618f8ff2089948b950e67e7 (diff)
downloadchromium_src-055aedeb2134e49c10c3b3a3593cb8df768d737c.zip
chromium_src-055aedeb2134e49c10c3b3a3593cb8df768d737c.tar.gz
chromium_src-055aedeb2134e49c10c3b3a3593cb8df768d737c.tar.bz2
Clean up the strings for sync code:
- Use FilePath for real file paths. - Use std::string for PathString on Windows as well TODO in a separate CL: - Get rid of PathString typedef completely and directly use std::string everywhere. - Use wchar_t in syncapi.h/.cc and get rid of sync_char16. TEST=Existing tests are sufficient since this CL does a lot of code refactoring. BUG=26342 Review URL: http://codereview.chromium.org/340055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30970 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/sync')
-rw-r--r--chrome/test/sync/engine/mock_server_connection.cc3
-rw-r--r--chrome/test/sync/engine/test_directory_setter_upper.cc13
-rw-r--r--chrome/test/sync/engine/test_directory_setter_upper.h2
3 files changed, 8 insertions, 10 deletions
diff --git a/chrome/test/sync/engine/mock_server_connection.cc b/chrome/test/sync/engine/mock_server_connection.cc
index e4fd70a..c9e3be5 100644
--- a/chrome/test/sync/engine/mock_server_connection.cc
+++ b/chrome/test/sync/engine/mock_server_connection.cc
@@ -381,8 +381,7 @@ void MockConnectionManager::AddUpdateExtendedAttributes(SyncEntity* ent,
for (int i = 0; i < xattr_count; i++) {
sync_pb::ExtendedAttributes_ExtendedAttribute* extended_attribute =
mutable_extended_attributes->add_extendedattribute();
- extended_attribute->set_key(static_cast<const string&>
- (browser_sync::ToUTF8(xattr_key[i])));
+ extended_attribute->set_key(xattr_key[i]);
SyncerProtoUtil::CopyBlobIntoProtoBytes(xattr_value[i],
extended_attribute->mutable_value());
}
diff --git a/chrome/test/sync/engine/test_directory_setter_upper.cc b/chrome/test/sync/engine/test_directory_setter_upper.cc
index 9e910f0..a41f160 100644
--- a/chrome/test/sync/engine/test_directory_setter_upper.cc
+++ b/chrome/test/sync/engine/test_directory_setter_upper.cc
@@ -4,11 +4,10 @@
#include "chrome/test/sync/engine/test_directory_setter_upper.h"
+#include "base/file_util.h"
#include "base/string_util.h"
#include "chrome/browser/sync/syncable/directory_manager.h"
#include "chrome/browser/sync/syncable/syncable.h"
-#include "chrome/browser/sync/util/character_set_converters.h"
-#include "chrome/browser/sync/util/compat_file.h"
#include "chrome/browser/sync/util/event_sys-inl.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -25,10 +24,10 @@ TestDirectorySetterUpper::TestDirectorySetterUpper(const PathString& name)
TestDirectorySetterUpper::~TestDirectorySetterUpper() {}
void TestDirectorySetterUpper::Init() {
- PathString test_data_dir_ = PSTR(".");
+ FilePath test_data_dir_(FILE_PATH_LITERAL("."));
manager_.reset(new DirectoryManager(test_data_dir_));
file_path_ = manager_->GetSyncDataDatabasePath();
- PathRemove(file_path_.c_str());
+ file_util::Delete(file_path_, false);
}
void TestDirectorySetterUpper::SetUp() {
@@ -54,8 +53,8 @@ void TestDirectorySetterUpper::TearDown() {
manager()->FinalSaveChangesForAll();
manager()->Close(name());
manager_.reset();
- EXPECT_EQ(0, PathRemove(file_path_.c_str()));
- file_path_.clear();
+ EXPECT_TRUE(file_util::Delete(file_path_, false));
+ file_path_ = FilePath(FILE_PATH_LITERAL(""));
}
void TestDirectorySetterUpper::RunInvariantCheck(const ScopedDirLookup& dir) {
@@ -88,7 +87,7 @@ void ManuallyOpenedTestDirectorySetterUpper::TearDown() {
TriggeredOpenTestDirectorySetterUpper::TriggeredOpenTestDirectorySetterUpper(
const std::string& name)
- : TestDirectorySetterUpper(UTF8ToPathStringQuick(name)) {
+ : TestDirectorySetterUpper(name) {
}
void TriggeredOpenTestDirectorySetterUpper::SetUp() {
diff --git a/chrome/test/sync/engine/test_directory_setter_upper.h b/chrome/test/sync/engine/test_directory_setter_upper.h
index 3c8936a..7e2cf48 100644
--- a/chrome/test/sync/engine/test_directory_setter_upper.h
+++ b/chrome/test/sync/engine/test_directory_setter_upper.h
@@ -68,7 +68,7 @@ class TestDirectorySetterUpper {
scoped_ptr<syncable::DirectoryManager> manager_;
const PathString name_;
- PathString file_path_;
+ FilePath file_path_;
};
// A variant of the above where SetUp does not actually open the directory.