diff options
-rw-r--r-- | chrome/browser/sync/engine/auth_watcher_unittest.cc | 9 | ||||
-rw-r--r-- | chrome/browser/sync/engine/syncapi.cc | 2 | ||||
-rw-r--r-- | chrome/browser/sync/syncable/syncable_unittest.cc | 48 | ||||
-rw-r--r-- | chrome/test/sync/engine/test_directory_setter_upper.cc | 12 |
4 files changed, 16 insertions, 55 deletions
diff --git a/chrome/browser/sync/engine/auth_watcher_unittest.cc b/chrome/browser/sync/engine/auth_watcher_unittest.cc index 1233b00..b483e82 100644 --- a/chrome/browser/sync/engine/auth_watcher_unittest.cc +++ b/chrome/browser/sync/engine/auth_watcher_unittest.cc @@ -17,7 +17,8 @@ #include "chrome/test/sync/engine/test_directory_setter_upper.h" #include "testing/gtest/include/gtest/gtest.h" -static const wchar_t* kUserSettingsDB = L"Settings.sqlite3"; +static FilePath::CharType kUserSettingsDB[] = + FILE_PATH_LITERAL("Settings.sqlite3"); static const char* kTestUserAgent = "useragent"; static const char* kTestServiceId = "serviceid"; static const char* kTestGaiaURL = "http://gaia_url"; @@ -76,9 +77,9 @@ namespace browser_sync { class AuthWatcherTest : public testing::Test { public: - AuthWatcherTest() : consumer_ready(false, false), - event_produced(false, false), - metadb_(kUserDisplayEmail) {} + AuthWatcherTest() : metadb_(kUserDisplayEmail), + consumer_ready(false, false), + event_produced(false, false) {} virtual void SetUp() { metadb_.SetUp(); connection_.reset(new MockConnectionManager(metadb_.manager(), diff --git a/chrome/browser/sync/engine/syncapi.cc b/chrome/browser/sync/engine/syncapi.cc index 4a853b0..2206024 100644 --- a/chrome/browser/sync/engine/syncapi.cc +++ b/chrome/browser/sync/engine/syncapi.cc @@ -690,8 +690,8 @@ class SyncManager::SyncInternal { command_channel_(0), auth_problem_(AUTH_PROBLEM_NONE), sync_manager_(sync_manager), - notification_pending_(false), address_watch_thread_("SyncEngine_AddressWatcher"), + notification_pending_(false), initialized_(false) { } diff --git a/chrome/browser/sync/syncable/syncable_unittest.cc b/chrome/browser/sync/syncable/syncable_unittest.cc index cbfcfbe..517c751 100644 --- a/chrome/browser/sync/syncable/syncable_unittest.cc +++ b/chrome/browser/sync/syncable/syncable_unittest.cc @@ -35,7 +35,6 @@ #include "base/scoped_ptr.h" #include "chrome/browser/sync/syncable/directory_backing_store.h" #include "chrome/browser/sync/syncable/directory_manager.h" -#include "chrome/browser/sync/util/character_set_converters.h" #include "chrome/browser/sync/util/closure.h" #include "chrome/browser/sync/util/compat_file.h" #include "chrome/browser/sync/util/event_sys-inl.h" @@ -1059,53 +1058,6 @@ TEST(SyncableDirectory, StressTransactions) { PathRemove(dirman.GetSyncDataDatabasePath()); } -static PathString UTF8ToPathStringQuick(const char* str) { - PathString ret; - CHECK(browser_sync::UTF8ToPathString(str, strlen(str), &ret)); - return ret; -} - -// Returns number of chars used. Max possible is 4. -// This algorithm was coded from the table at -// http://en.wikipedia.org/w/index.php?title=UTF-8&oldid=153391259 -// There are no endian issues. -static int UTF32ToUTF8(uint32 incode, unsigned char* out) { - if (incode <= 0x7f) { - out[0] = incode; - return 1; - } - if (incode <= 0x7ff) { - out[0] = 0xC0; - out[0] |= (incode >> 6); - out[1] = 0x80; - out[1] |= (incode & 0x3F); - return 2; - } - if (incode <= 0xFFFF) { - if ((incode > 0xD7FF) && (incode < 0xE000)) - return 0; - out[0] = 0xE0; - out[0] |= (incode >> 12); - out[1] = 0x80; - out[1] |= (incode >> 6) & 0x3F; - out[2] = 0x80; - out[2] |= incode & 0x3F; - return 3; - } - if (incode <= 0x10FFFF) { - out[0] = 0xF0; - out[0] |= incode >> 18; - out[1] = 0x80; - out[1] |= (incode >> 12) & 0x3F; - out[2] = 0x80; - out[2] |= (incode >> 6) & 0x3F; - out[3] = 0x80; - out[3] |= incode & 0x3F; - return 4; - } - return 0; -} - TEST(Syncable, ComparePathNames) { struct { char a; diff --git a/chrome/test/sync/engine/test_directory_setter_upper.cc b/chrome/test/sync/engine/test_directory_setter_upper.cc index 919ce2a..2685795 100644 --- a/chrome/test/sync/engine/test_directory_setter_upper.cc +++ b/chrome/test/sync/engine/test_directory_setter_upper.cc @@ -7,6 +7,7 @@ #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" @@ -84,9 +85,16 @@ void ManuallyOpenedTestDirectorySetterUpper::TearDown() { TestDirectorySetterUpper::TearDown(); } } + +static PathString UTF8ToPathStringQuick(const std::string &str) { + PathString ret; + CHECK(browser_sync::UTF8ToPathString(str.data(), str.size(), &ret)); + return ret; +} TriggeredOpenTestDirectorySetterUpper::TriggeredOpenTestDirectorySetterUpper( - const std::string& name) : TestDirectorySetterUpper(UTF8ToWide(name)) { + const std::string& name) + : TestDirectorySetterUpper(UTF8ToPathStringQuick(name)) { } void TriggeredOpenTestDirectorySetterUpper::SetUp() { @@ -97,7 +105,7 @@ void TriggeredOpenTestDirectorySetterUpper::TearDown() { DirectoryManager::DirNames names; manager()->GetOpenDirectories(&names); if (!names.empty()) { - ASSERT_EQ(1, names.size()); + ASSERT_EQ(1U, names.size()); ASSERT_EQ(name(), names[0]); TestDirectorySetterUpper::TearDown(); } |