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

Unified Diff: ui/base/resource/data_pack_unittest.cc

Issue 7779019: Removed sample.pak binary from checkout. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: ui/base/resource/data_pack_unittest.cc
diff --git a/ui/base/resource/data_pack_unittest.cc b/ui/base/resource/data_pack_unittest.cc
index 032196f80e9ecb5a204d880bfc4e70a6d7912670..ad747bd1e4300483cb8412d688104ad41b7ba09f 100644
--- a/ui/base/resource/data_pack_unittest.cc
+++ b/ui/base/resource/data_pack_unittest.cc
@@ -12,12 +12,22 @@
namespace ui {
+extern const char kSamplePakContents[];
+extern const size_t kSamplePakSize;
+
TEST(DataPackTest, Load) {
- FilePath data_path;
- PathService::Get(base::DIR_SOURCE_ROOT, &data_path);
- data_path = data_path.Append(
- FILE_PATH_LITERAL("ui/base/test/data/data_pack_unittest/sample.pak"));
+ ScopedTempDir dir;
+ ASSERT_TRUE(dir.CreateUniqueTempDir());
+ FilePath data_path = dir.path().Append(FILE_PATH_LITERAL("sample.pak"));
+
+ // Dump contents into the pak file.
+ FILE* file = file_util::OpenFile(data_path, "wb");
tony 2011/09/02 23:10:51 Can we just use file_util::WriteFile?
marcvs 2011/09/02 23:27:27 Done.
+ ASSERT_TRUE(file);
+ ASSERT_EQ(fwrite(kSamplePakContents, 1, kSamplePakSize, file),
+ kSamplePakSize);
+ file_util::CloseFile(file);
+ // Load the file through the data pack API.
DataPack pack;
ASSERT_TRUE(pack.Load(data_path));

Powered by Google App Engine
This is Rietveld 408576698