diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-16 02:43:28 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-16 02:43:28 +0000 |
commit | 38dc6d7d2e7f36490dbe6aed60cccfc76b11af45 (patch) | |
tree | 45b735c54b023e85b119a39b6425966a4c57c884 /chrome/browser/sync/util | |
parent | a78410304ccc90a44852c9714317787c63bb50a3 (diff) | |
download | chromium_src-38dc6d7d2e7f36490dbe6aed60cccfc76b11af45.zip chromium_src-38dc6d7d2e7f36490dbe6aed60cccfc76b11af45.tar.gz chromium_src-38dc6d7d2e7f36490dbe6aed60cccfc76b11af45.tar.bz2 |
TBR: nick@chromium.org
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29240 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync/util')
-rw-r--r-- | chrome/browser/sync/util/character_set_converters.h | 15 | ||||
-rw-r--r-- | chrome/browser/sync/util/user_settings_unittest.cc | 12 |
2 files changed, 7 insertions, 20 deletions
diff --git a/chrome/browser/sync/util/character_set_converters.h b/chrome/browser/sync/util/character_set_converters.h index 6a833ee..1db32c7 100644 --- a/chrome/browser/sync/util/character_set_converters.h +++ b/chrome/browser/sync/util/character_set_converters.h @@ -136,21 +136,6 @@ inline void AppendPathStringToUTF8(const PathString& wide, return AppendPathStringToUTF8(wide.data(), wide.length(), output_string); } -// Versions of UTF8ToPathString/PathStringToUTF8 that return the converted -// string directly. Any errors encountered will CHECK(). These functions are -// intended to be used only for testing. - -inline PathString UTF8ToPathStringQuick(const std::string &utf8) { - PathString wide; - CHECK(UTF8ToPathString(utf8.data(), utf8.size(), &wide)); - return wide; -} - -inline std::string PathStringToUTF8Quick(const PathString& wide) { - std::string utf8; - PathStringToUTF8(wide.data(), wide.size(), &utf8); - return utf8; -} inline bool Append(const PathChar* wide, int size, std::string* output_string) { diff --git a/chrome/browser/sync/util/user_settings_unittest.cc b/chrome/browser/sync/util/user_settings_unittest.cc index 02f3fd8..952c86b 100644 --- a/chrome/browser/sync/util/user_settings_unittest.cc +++ b/chrome/browser/sync/util/user_settings_unittest.cc @@ -2,12 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE entry. -#include <string> - #include "base/file_util.h" #include "base/test/test_file_util.h" #include "chrome/browser/sync/syncable/directory_manager.h" -#include "chrome/browser/sync/util/character_set_converters.h" #include "chrome/browser/sync/util/user_settings.h" #include "chrome/browser/sync/util/query_helpers.h" #include "testing/gtest/include/gtest/gtest.h" @@ -43,10 +40,15 @@ class UserSettingsTest : public testing::Test { ExecOrDie(primer_handle, "CREATE TABLE shares" " (email, share_name, file_name," " PRIMARY KEY(email, share_name) ON CONFLICT REPLACE)"); +#if OS_WIN + // Populate a share. + ExecOrDie(primer_handle, "INSERT INTO shares values ( ?, ?, ?)", + "foo@foo.com", "foo@foo.com", WideToUTF8(kOldStyleSyncDataDB)); +#elif OS_LINUX // Populate a share. ExecOrDie(primer_handle, "INSERT INTO shares values ( ?, ?, ?)", - "foo@foo.com", "foo@foo.com", - browser_sync::PathStringToUTF8Quick(kOldStyleSyncDataDB)); + "foo@foo.com", "foo@foo.com", kOldStyleSyncDataDB); +#endif sqlite3_close(primer_handle); } |