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

Side by Side Diff: ui/base/resource/resource_bundle_unittest.cc

Issue 10151025: Add scale factor tag to data packs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 7 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
« no previous file with comments | « ui/base/resource/resource_bundle_mac.mm ('k') | ui/base/resource/resource_bundle_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/base/resource/resource_bundle.h" 5 #include "ui/base/resource/resource_bundle.h"
6 6
7 #include "base/base_paths.h" 7 #include "base/base_paths.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 22 matching lines...) Expand all
33 static_cast<int>(kSamplePakSize)); 33 static_cast<int>(kSamplePakSize));
34 34
35 // Create a resource bundle from the file. 35 // Create a resource bundle from the file.
36 resource_bundle.LoadTestResources(data_path); 36 resource_bundle.LoadTestResources(data_path);
37 37
38 const int kUnfoundResourceId = 10000; 38 const int kUnfoundResourceId = 10000;
39 EXPECT_EQ(NULL, resource_bundle.LoadDataResourceBytes(kUnfoundResourceId)); 39 EXPECT_EQ(NULL, resource_bundle.LoadDataResourceBytes(kUnfoundResourceId));
40 40
41 // Give a .pak file that doesn't exist so we will fail to load it. 41 // Give a .pak file that doesn't exist so we will fail to load it.
42 resource_bundle.AddDataPack(FilePath( 42 resource_bundle.AddDataPack(FilePath(
43 FILE_PATH_LITERAL("non-existant-file.pak"))); 43 FILE_PATH_LITERAL("non-existant-file.pak")), 1.0);
44 EXPECT_EQ(NULL, resource_bundle.LoadDataResourceBytes(kUnfoundResourceId)); 44 EXPECT_EQ(NULL, resource_bundle.LoadDataResourceBytes(kUnfoundResourceId));
45 } 45 }
46 46
47 TEST(ResourceBundle, LocaleDataPakExists) { 47 TEST(ResourceBundle, LocaleDataPakExists) {
48 // Check that ResourceBundle::LocaleDataPakExists returns the correct results. 48 // Check that ResourceBundle::LocaleDataPakExists returns the correct results.
49 EXPECT_TRUE(ResourceBundle::LocaleDataPakExists("en-US")); 49 EXPECT_TRUE(ResourceBundle::LocaleDataPakExists("en-US"));
50 EXPECT_FALSE(ResourceBundle::LocaleDataPakExists("not_a_real_locale")); 50 EXPECT_FALSE(ResourceBundle::LocaleDataPakExists("not_a_real_locale"));
51 } 51 }
52 52
53 } // namespace ui 53 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/resource/resource_bundle_mac.mm ('k') | ui/base/resource/resource_bundle_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698