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 "chrome/browser/extensions/image_loader.h" | 5 #include "chrome/browser/extensions/image_loader.h" |
6 | 6 |
7 #include "base/json/json_file_value_serializer.h" | 7 #include "base/json/json_file_value_serializer.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 base::Bind(&ImageLoaderTest::OnImageLoaded, | 175 base::Bind(&ImageLoaderTest::OnImageLoaded, |
176 base::Unretained(this))); | 176 base::Unretained(this))); |
177 | 177 |
178 // The image isn't cached, so we should not have received notification. | 178 // The image isn't cached, so we should not have received notification. |
179 EXPECT_EQ(0, image_loaded_count()); | 179 EXPECT_EQ(0, image_loaded_count()); |
180 | 180 |
181 // Send out notification the extension was uninstalled. | 181 // Send out notification the extension was uninstalled. |
182 UnloadedExtensionInfo details(extension.get(), | 182 UnloadedExtensionInfo details(extension.get(), |
183 UnloadedExtensionInfo::REASON_UNINSTALL); | 183 UnloadedExtensionInfo::REASON_UNINSTALL); |
184 content::NotificationService::current()->Notify( | 184 content::NotificationService::current()->Notify( |
185 chrome::NOTIFICATION_EXTENSION_UNLOADED, | 185 chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, |
186 content::NotificationService::AllSources(), | 186 content::NotificationService::AllSources(), |
187 content::Details<UnloadedExtensionInfo>(&details)); | 187 content::Details<UnloadedExtensionInfo>(&details)); |
188 | 188 |
189 // Chuck the extension, that way if anyone tries to access it we should crash | 189 // Chuck the extension, that way if anyone tries to access it we should crash |
190 // or get valgrind errors. | 190 // or get valgrind errors. |
191 extension = NULL; | 191 extension = NULL; |
192 | 192 |
193 WaitForImageLoad(); | 193 WaitForImageLoad(); |
194 | 194 |
195 // Even though we deleted the extension, we should still get the image. | 195 // Even though we deleted the extension, we should still get the image. |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 | 328 |
329 #if defined(OS_CHROMEOS) | 329 #if defined(OS_CHROMEOS) |
330 int resource_id; | 330 int resource_id; |
331 ASSERT_EQ(true, | 331 ASSERT_EQ(true, |
332 ImageLoader::IsComponentExtensionResource(extension->path(), | 332 ImageLoader::IsComponentExtensionResource(extension->path(), |
333 resource.relative_path(), | 333 resource.relative_path(), |
334 &resource_id)); | 334 &resource_id)); |
335 ASSERT_EQ(IDR_FILE_MANAGER_ICON_16, resource_id); | 335 ASSERT_EQ(IDR_FILE_MANAGER_ICON_16, resource_id); |
336 #endif | 336 #endif |
337 } | 337 } |
OLD | NEW |