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

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

Issue 15967013: Rewrite scoped_ptr<T>(NULL) to use the default ctor in ui/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | « no previous file | no next file » | 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_util.h" 8 #include "base/file_util.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 TEST_F(ResourceBundleTest, LocaleDataPakExists) { 327 TEST_F(ResourceBundleTest, LocaleDataPakExists) {
328 ResourceBundle* resource_bundle = CreateResourceBundle(NULL); 328 ResourceBundle* resource_bundle = CreateResourceBundle(NULL);
329 329
330 // Check that ResourceBundle::LocaleDataPakExists returns the correct results. 330 // Check that ResourceBundle::LocaleDataPakExists returns the correct results.
331 EXPECT_TRUE(resource_bundle->LocaleDataPakExists("en-US")); 331 EXPECT_TRUE(resource_bundle->LocaleDataPakExists("en-US"));
332 EXPECT_FALSE(resource_bundle->LocaleDataPakExists("not_a_real_locale")); 332 EXPECT_FALSE(resource_bundle->LocaleDataPakExists("not_a_real_locale"));
333 } 333 }
334 334
335 class ResourceBundleImageTest : public ResourceBundleTest { 335 class ResourceBundleImageTest : public ResourceBundleTest {
336 public: 336 public:
337 ResourceBundleImageTest() : locale_pack_(NULL) { 337 ResourceBundleImageTest() {}
338 }
339 338
340 virtual ~ResourceBundleImageTest() { 339 virtual ~ResourceBundleImageTest() {
341 } 340 }
342 341
343 virtual void SetUp() OVERRIDE { 342 virtual void SetUp() OVERRIDE {
344 // Create a temporary directory to write test resource bundles to. 343 // Create a temporary directory to write test resource bundles to.
345 ASSERT_TRUE(dir_.CreateUniqueTempDir()); 344 ASSERT_TRUE(dir_.CreateUniqueTempDir());
346 } 345 }
347 346
348 // Returns resource bundle which uses an empty data pak for locale data. 347 // Returns resource bundle which uses an empty data pak for locale data.
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 ResourceBundle* resource_bundle = CreateResourceBundleWithEmptyLocalePak(); 540 ResourceBundle* resource_bundle = CreateResourceBundleWithEmptyLocalePak();
542 resource_bundle->AddDataPackFromPath(data_default_path, SCALE_FACTOR_NONE); 541 resource_bundle->AddDataPackFromPath(data_default_path, SCALE_FACTOR_NONE);
543 542
544 gfx::ImageSkia* image_skia = resource_bundle->GetImageSkiaNamed(3); 543 gfx::ImageSkia* image_skia = resource_bundle->GetImageSkiaNamed(3);
545 EXPECT_EQ(1u, image_skia->image_reps().size()); 544 EXPECT_EQ(1u, image_skia->image_reps().size());
546 EXPECT_EQ(ui::SCALE_FACTOR_100P, 545 EXPECT_EQ(ui::SCALE_FACTOR_100P,
547 image_skia->image_reps()[0].scale_factor()); 546 image_skia->image_reps()[0].scale_factor());
548 } 547 }
549 548
550 } // namespace ui 549 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698