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/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 &command_line, base::FilePath(), false); | 60 &command_line, base::FilePath(), false); |
61 } | 61 } |
62 | 62 |
63 // Load test icon from extension test directory. | 63 // Load test icon from extension test directory. |
64 SkBitmap LoadTestIcon() { | 64 SkBitmap LoadTestIcon() { |
65 base::FilePath path; | 65 base::FilePath path; |
66 PathService::Get(chrome::DIR_TEST_DATA, &path); | 66 PathService::Get(chrome::DIR_TEST_DATA, &path); |
67 path = path.AppendASCII("extensions").AppendASCII("icon1.png"); | 67 path = path.AppendASCII("extensions").AppendASCII("icon1.png"); |
68 | 68 |
69 std::string file_contents; | 69 std::string file_contents; |
70 file_util::ReadFileToString(path, &file_contents); | 70 base::ReadFileToString(path, &file_contents); |
71 const unsigned char* data = | 71 const unsigned char* data = |
72 reinterpret_cast<const unsigned char*>(file_contents.data()); | 72 reinterpret_cast<const unsigned char*>(file_contents.data()); |
73 | 73 |
74 SkBitmap bitmap; | 74 SkBitmap bitmap; |
75 gfx::PNGCodec::Decode(data, file_contents.length(), &bitmap); | 75 gfx::PNGCodec::Decode(data, file_contents.length(), &bitmap); |
76 return bitmap; | 76 return bitmap; |
77 } | 77 } |
78 | 78 |
79 // Create a skeletal framework of either page action or browser action | 79 // Create a skeletal framework of either page action or browser action |
80 // type. This extension only needs to have a type and a name to initialize | 80 // type. This extension only needs to have a type and a name to initialize |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 int minHeight = extension_installed_bubble::kIconSize + | 303 int minHeight = extension_installed_bubble::kIconSize + |
304 (2 * extension_installed_bubble::kOuterVerticalMargin); | 304 (2 * extension_installed_bubble::kOuterVerticalMargin); |
305 EXPECT_GT(height, minHeight); | 305 EXPECT_GT(height, minHeight); |
306 | 306 |
307 // Make sure the "show me" link is visible. | 307 // Make sure the "show me" link is visible. |
308 EXPECT_FALSE([[controller appInstalledShortcutLink] isHidden]); | 308 EXPECT_FALSE([[controller appInstalledShortcutLink] isHidden]); |
309 | 309 |
310 [controller close]; | 310 [controller close]; |
311 } | 311 } |
312 | 312 |
OLD | NEW |