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

Side by Side Diff: webkit/browser/fileapi/sandbox_isolated_origin_database_unittest.cc

Issue 19579005: Move ReadFileToString to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/files/scoped_temp_dir.h" 7 #include "base/files/scoped_temp_dir.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "webkit/browser/fileapi/sandbox_isolated_origin_database.h" 9 #include "webkit/browser/fileapi/sandbox_isolated_origin_database.h"
10 #include "webkit/browser/fileapi/sandbox_origin_database.h" 10 #include "webkit/browser/fileapi/sandbox_origin_database.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 EXPECT_TRUE(database.HasOriginPath(kOrigin)); 69 EXPECT_TRUE(database.HasOriginPath(kOrigin));
70 EXPECT_TRUE(database.GetPathForOrigin(kOrigin, &path)); 70 EXPECT_TRUE(database.GetPathForOrigin(kOrigin, &path));
71 EXPECT_FALSE(path.empty()); 71 EXPECT_FALSE(path.empty());
72 72
73 // The directory content must be kept (or migrated if necessary), 73 // The directory content must be kept (or migrated if necessary),
74 // so we should see the same fake data. 74 // so we should see the same fake data.
75 std::string origin_db_data; 75 std::string origin_db_data;
76 base::FilePath directory_db_path = dir.path().Append(path); 76 base::FilePath directory_db_path = dir.path().Append(path);
77 EXPECT_TRUE(base::DirectoryExists(directory_db_path)); 77 EXPECT_TRUE(base::DirectoryExists(directory_db_path));
78 EXPECT_TRUE(base::PathExists(directory_db_path.AppendASCII("dummy"))); 78 EXPECT_TRUE(base::PathExists(directory_db_path.AppendASCII("dummy")));
79 EXPECT_TRUE(file_util::ReadFileToString( 79 EXPECT_TRUE(base::ReadFileToString(
80 directory_db_path.AppendASCII("dummy"), &origin_db_data)); 80 directory_db_path.AppendASCII("dummy"), &origin_db_data));
81 EXPECT_EQ(kFakeDirectoryData, origin_db_data); 81 EXPECT_EQ(kFakeDirectoryData, origin_db_data);
82 82
83 // After the migration the database must be gone. 83 // After the migration the database must be gone.
84 EXPECT_FALSE(base::PathExists(old_db_path)); 84 EXPECT_FALSE(base::PathExists(old_db_path));
85 } 85 }
86 86
87 } // namespace fileapi 87 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/browser/fileapi/obfuscated_file_util_unittest.cc ('k') | webkit/support/test_webkit_platform_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698