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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.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/json/json_file_value_serializer.h" | 10 #include "base/json/json_file_value_serializer.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 protected: | 41 protected: |
42 void LoadIcon() { | 42 void LoadIcon() { |
43 std::string file_contents; | 43 std::string file_contents; |
44 file_util::ReadFileToString(test_data_dir_.AppendASCII("icon.png"), | 44 file_util::ReadFileToString(test_data_dir_.AppendASCII("icon.png"), |
45 &file_contents); | 45 &file_contents); |
46 | 46 |
47 webkit_glue::ImageDecoder decoder; | 47 webkit_glue::ImageDecoder decoder; |
48 SkBitmap bitmap = decoder.Decode( | 48 SkBitmap bitmap = decoder.Decode( |
49 reinterpret_cast<const unsigned char*>(file_contents.c_str()), | 49 reinterpret_cast<const unsigned char*>(file_contents.c_str()), |
50 file_contents.length()); | 50 file_contents.length()); |
51 icon_ = gfx::Image(new SkBitmap(bitmap)); | 51 icon_ = gfx::Image(bitmap); |
52 } | 52 } |
53 | 53 |
54 void LoadExtension() { | 54 void LoadExtension() { |
55 FilePath path = test_data_dir_.AppendASCII("extension.json"); | 55 FilePath path = test_data_dir_.AppendASCII("extension.json"); |
56 | 56 |
57 std::string error; | 57 std::string error; |
58 JSONFileValueSerializer serializer(path); | 58 JSONFileValueSerializer serializer(path); |
59 scoped_ptr<DictionaryValue> value(static_cast<DictionaryValue*>( | 59 scoped_ptr<DictionaryValue> value(static_cast<DictionaryValue*>( |
60 serializer.Deserialize(NULL, &error))); | 60 serializer.Deserialize(NULL, &error))); |
61 if (!value.get()) { | 61 if (!value.get()) { |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 | 333 |
334 // Though we have no permissions warnings, these should still be hooked up, | 334 // Though we have no permissions warnings, these should still be hooked up, |
335 // just invisible. | 335 // just invisible. |
336 EXPECT_TRUE([controller subtitleField] != nil); | 336 EXPECT_TRUE([controller subtitleField] != nil); |
337 EXPECT_TRUE([[controller subtitleField] isHidden]); | 337 EXPECT_TRUE([[controller subtitleField] isHidden]); |
338 EXPECT_TRUE([controller warningsField] != nil); | 338 EXPECT_TRUE([controller warningsField] != nil); |
339 EXPECT_TRUE([[controller warningsField] isHidden]); | 339 EXPECT_TRUE([[controller warningsField] isHidden]); |
340 EXPECT_TRUE([controller warningsSeparator] != nil); | 340 EXPECT_TRUE([controller warningsSeparator] != nil); |
341 EXPECT_TRUE([[controller warningsSeparator] isHidden]); | 341 EXPECT_TRUE([[controller warningsSeparator] isHidden]); |
342 } | 342 } |
OLD | NEW |