summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorqsr@google.com <qsr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-27 15:19:15 +0000
committerqsr@google.com <qsr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-27 15:19:15 +0000
commit79e75fa9e0b140636bbaafdc36a8fcab4a0cf3df (patch)
treed926463dedfa71150c49a23889ce838037d2e4e7 /chrome/browser
parentb99c41c5e0799d1d8c86e01ee20ef100bd6bbb68 (diff)
downloadchromium_src-79e75fa9e0b140636bbaafdc36a8fcab4a0cf3df.zip
chromium_src-79e75fa9e0b140636bbaafdc36a8fcab4a0cf3df.tar.gz
chromium_src-79e75fa9e0b140636bbaafdc36a8fcab4a0cf3df.tar.bz2
Use standard way to create a temporary db file.
BUG=none TEST=tests pass Review URL: http://codereview.chromium.org/6905057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83158 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/sync/syncable/syncable_unittest.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/chrome/browser/sync/syncable/syncable_unittest.cc b/chrome/browser/sync/syncable/syncable_unittest.cc
index 17523e5..78b6e15 100644
--- a/chrome/browser/sync/syncable/syncable_unittest.cc
+++ b/chrome/browser/sync/syncable/syncable_unittest.cc
@@ -315,14 +315,16 @@ class TestUnsaveableDirectory : public Directory {
// Test suite for syncable::Directory.
class SyncableDirectoryTest : public testing::Test {
protected:
- static const FilePath::CharType kFilePath[];
+ ScopedTempDir temp_dir_;
static const char kName[];
static const Id kId;
// SetUp() is called before each test case is run.
// The sqlite3 DB is deleted before each test is run.
virtual void SetUp() {
- file_path_ = FilePath(kFilePath);
+ ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
+ file_path_ = temp_dir_.path().Append(
+ FILE_PATH_LITERAL("Test.sqlite3"));
file_util::Delete(file_path_, true);
dir_.reset(new Directory());
ASSERT_TRUE(dir_.get());
@@ -675,8 +677,6 @@ TEST_F(SyncableDirectoryTest, TakeSnapshotGetsOnlyDirtyHandlesTest) {
}
}
-const FilePath::CharType SyncableDirectoryTest::kFilePath[] =
- FILE_PATH_LITERAL("Test.sqlite3");
const char SyncableDirectoryTest::kName[] = "Foo";
const Id SyncableDirectoryTest::kId(TestIdFactory::FromNumber(-99));
@@ -1199,7 +1199,7 @@ TEST_F(SyncableDirectoryTest, TestSaveChangesFailure) {
// always fail.
dir_.reset(new TestUnsaveableDirectory());
ASSERT_TRUE(dir_.get());
- ASSERT_TRUE(OPENED == dir_->Open(FilePath(kFilePath), kName));
+ ASSERT_TRUE(OPENED == dir_->Open(file_path_, kName));
ASSERT_TRUE(dir_->good());
int64 handle2 = 0;
{
@@ -1272,7 +1272,7 @@ TEST_F(SyncableDirectoryTest, TestSaveChangesFailureWithPurge) {
// always fail.
dir_.reset(new TestUnsaveableDirectory());
ASSERT_TRUE(dir_.get());
- ASSERT_TRUE(OPENED == dir_->Open(FilePath(kFilePath), kName));
+ ASSERT_TRUE(OPENED == dir_->Open(file_path_, kName));
ASSERT_TRUE(dir_->good());
ModelTypeSet set;