OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #import <AppKit/AppKit.h> | 7 #import <AppKit/AppKit.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 num_material_packs++; | 138 num_material_packs++; |
139 } | 139 } |
140 | 140 |
141 return num_material_packs; | 141 return num_material_packs; |
142 } | 142 } |
143 | 143 |
144 protected: | 144 protected: |
145 ResourceBundle* resource_bundle_; | 145 ResourceBundle* resource_bundle_; |
146 | 146 |
147 private: | 147 private: |
148 scoped_ptr<DataPack> locale_pack_; | 148 std::unique_ptr<DataPack> locale_pack_; |
149 base::ScopedTempDir dir_; | 149 base::ScopedTempDir dir_; |
150 | 150 |
151 DISALLOW_COPY_AND_ASSIGN(ResourceBundleMacImageTest); | 151 DISALLOW_COPY_AND_ASSIGN(ResourceBundleMacImageTest); |
152 }; | 152 }; |
153 | 153 |
154 // Verifies that ResourceBundle searches the Material Design data pack before | 154 // Verifies that ResourceBundle searches the Material Design data pack before |
155 // the default data pack, and that the returned image contains only the | 155 // the default data pack, and that the returned image contains only the |
156 // representation from the Material Design pack. | 156 // representation from the Material Design pack. |
157 TEST_F(ResourceBundleMacImageTest, CheckImageFromMaterialDesign) { | 157 TEST_F(ResourceBundleMacImageTest, CheckImageFromMaterialDesign) { |
158 // Create two .pak files, each containing a single image with the | 158 // Create two .pak files, each containing a single image with the |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 // Design pack, any images it contains should override the ones in the default | 196 // Design pack, any images it contains should override the ones in the default |
197 // pack, so if both packs contain the same image, the returned NSImage should | 197 // pack, so if both packs contain the same image, the returned NSImage should |
198 // contain just a single representation. | 198 // contain just a single representation. |
199 NSImage* icon = resource_bundle->GetNativeImageNamed(3).ToNSImage(); | 199 NSImage* icon = resource_bundle->GetNativeImageNamed(3).ToNSImage(); |
200 const unsigned long representations_count = [[icon representations] count]; | 200 const unsigned long representations_count = [[icon representations] count]; |
201 const unsigned long expected_count = 1; | 201 const unsigned long expected_count = 1; |
202 EXPECT_EQ(expected_count, representations_count); | 202 EXPECT_EQ(expected_count, representations_count); |
203 } | 203 } |
204 | 204 |
205 } // namespace ui | 205 } // namespace ui |
OLD | NEW |