OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 <algorithm> | 5 #include <algorithm> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
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_reader.h" | 10 #include "base/json_reader.h" |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 ASSERT_FALSE(file_util::PathExists(dest_path)); | 292 ASSERT_FALSE(file_util::PathExists(dest_path)); |
293 } | 293 } |
294 | 294 |
295 // Test installing extensions. | 295 // Test installing extensions. |
296 TEST_F(ExtensionsServiceTest, InstallExtension) { | 296 TEST_F(ExtensionsServiceTest, InstallExtension) { |
297 FilePath extensions_path; | 297 FilePath extensions_path; |
298 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &extensions_path)); | 298 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &extensions_path)); |
299 extensions_path = extensions_path.AppendASCII("extensions"); | 299 extensions_path = extensions_path.AppendASCII("extensions"); |
300 | 300 |
301 // A simple extension that should install without error. | 301 // A simple extension that should install without error. |
| 302 // A simple extension that should install without error. |
302 FilePath path = extensions_path.AppendASCII("good.crx"); | 303 FilePath path = extensions_path.AppendASCII("good.crx"); |
303 TestInstallExtension(path, true); | 304 TestInstallExtension(path, true); |
| 305 |
304 // TODO(erikkay): verify the contents of the installed extension. | 306 // TODO(erikkay): verify the contents of the installed extension. |
305 | 307 |
| 308 // An extension with theme images. |
| 309 path = extensions_path.AppendASCII("theme.crx"); |
| 310 frontend->TestInstallExtension(path, backend, true); |
| 311 |
| 312 // An extension with page actions. |
| 313 path = extensions_path.AppendASCII("page_action.crx"); |
| 314 frontend->TestInstallExtension(path, backend, true); |
| 315 |
306 // 0-length extension file. | 316 // 0-length extension file. |
307 path = extensions_path.AppendASCII("not_an_extension.crx"); | 317 path = extensions_path.AppendASCII("not_an_extension.crx"); |
308 TestInstallExtension(path, false); | 318 TestInstallExtension(path, false); |
309 | 319 |
310 // Bad magic number. | 320 // Bad magic number. |
311 path = extensions_path.AppendASCII("bad_magic.crx"); | 321 path = extensions_path.AppendASCII("bad_magic.crx"); |
312 TestInstallExtension(path, false); | 322 TestInstallExtension(path, false); |
313 | 323 |
314 // Poorly formed JSON. | 324 // Poorly formed JSON. |
315 path = extensions_path.AppendASCII("bad_json.crx"); | 325 path = extensions_path.AppendASCII("bad_json.crx"); |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 service_->Init(); | 537 service_->Init(); |
528 loop_.RunAllPending(); | 538 loop_.RunAllPending(); |
529 ASSERT_EQ(0u, loaded_.size()); | 539 ASSERT_EQ(0u, loaded_.size()); |
530 } | 540 } |
531 | 541 |
532 #else | 542 #else |
533 | 543 |
534 // TODO(port) | 544 // TODO(port) |
535 | 545 |
536 #endif | 546 #endif |
OLD | NEW |