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

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: Updated. 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
« no previous file with comments | « ui/base/resource/data_pack_literal.cc ('k') | ui/base/resource/resource_bundle_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..fe3613c0140e2a3f9d0f3a3abc4e828b6893ab28 100644
--- a/ui/base/resource/data_pack_unittest.cc
+++ b/ui/base/resource/data_pack_unittest.cc
@@ -12,12 +12,19 @@
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.
+ ASSERT_EQ(file_util::WriteFile(data_path, kSamplePakContents, kSamplePakSize),
+ static_cast<int>(kSamplePakSize));
+ // Load the file through the data pack API.
DataPack pack;
ASSERT_TRUE(pack.Load(data_path));
« no previous file with comments | « ui/base/resource/data_pack_literal.cc ('k') | ui/base/resource/resource_bundle_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698