OLD | NEW |
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/big_endian.h" | 8 #include "base/big_endian.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 | 335 |
336 EXPECT_CALL(delegate, GetLocalizedStringMock(resource_id)).Times(1).WillOnce( | 336 EXPECT_CALL(delegate, GetLocalizedStringMock(resource_id)).Times(1).WillOnce( |
337 Return(delegate_data)); | 337 Return(delegate_data)); |
338 | 338 |
339 base::string16 override_data = base::ASCIIToUTF16("My override data"); | 339 base::string16 override_data = base::ASCIIToUTF16("My override data"); |
340 | 340 |
341 base::string16 result = resource_bundle->GetLocalizedString(resource_id); | 341 base::string16 result = resource_bundle->GetLocalizedString(resource_id); |
342 EXPECT_EQ(delegate_data, result); | 342 EXPECT_EQ(delegate_data, result); |
343 } | 343 } |
344 | 344 |
345 #if defined(USE_OZONE) && !defined(USE_PANGO) | 345 #if (defined(USE_OZONE) && !defined(USE_PANGO)) || defined(OS_ANDROID) |
346 #define MAYBE_DelegateGetFontList DISABLED_DelegateGetFontList | 346 #define MAYBE_DelegateGetFontList DISABLED_DelegateGetFontList |
347 #else | 347 #else |
348 #define MAYBE_DelegateGetFontList DelegateGetFontList | 348 #define MAYBE_DelegateGetFontList DelegateGetFontList |
349 #endif | 349 #endif |
350 | 350 |
351 TEST_F(ResourceBundleTest, MAYBE_DelegateGetFontList) { | 351 TEST_F(ResourceBundleTest, MAYBE_DelegateGetFontList) { |
352 MockResourceBundleDelegate delegate; | 352 MockResourceBundleDelegate delegate; |
353 ResourceBundle* resource_bundle = CreateResourceBundle(&delegate); | 353 ResourceBundle* resource_bundle = CreateResourceBundle(&delegate); |
354 | 354 |
355 // Should be called once for each font type. When we return NULL the default | 355 // Should be called once for each font type. When we return NULL the default |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 resource_bundle->AddDataPackFromPath(data_default_path, SCALE_FACTOR_NONE); | 621 resource_bundle->AddDataPackFromPath(data_default_path, SCALE_FACTOR_NONE); |
622 | 622 |
623 gfx::ImageSkia* image_skia = resource_bundle->GetImageSkiaNamed(3); | 623 gfx::ImageSkia* image_skia = resource_bundle->GetImageSkiaNamed(3); |
624 EXPECT_EQ(1u, image_skia->image_reps().size()); | 624 EXPECT_EQ(1u, image_skia->image_reps().size()); |
625 EXPECT_TRUE(image_skia->image_reps()[0].unscaled()); | 625 EXPECT_TRUE(image_skia->image_reps()[0].unscaled()); |
626 EXPECT_EQ(ui::SCALE_FACTOR_100P, | 626 EXPECT_EQ(ui::SCALE_FACTOR_100P, |
627 GetSupportedScaleFactor(image_skia->image_reps()[0].scale())); | 627 GetSupportedScaleFactor(image_skia->image_reps()[0].scale())); |
628 } | 628 } |
629 | 629 |
630 } // namespace ui | 630 } // namespace ui |
OLD | NEW |