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/common/extensions/extension_file_util.h" | 5 #include "chrome/common/extensions/extension_file_util.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/json/json_string_value_serializer.h" | 8 #include "base/json/json_string_value_serializer.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
11 #include "base/stringprintf.h" | 11 #include "base/stringprintf.h" |
12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
13 #include "chrome/common/chrome_paths.h" | 13 #include "chrome/common/chrome_paths.h" |
14 #include "chrome/common/extensions/extension.h" | 14 #include "chrome/common/extensions/extension.h" |
15 #include "chrome/common/extensions/extension_manifest_constants.h" | 15 #include "chrome/common/extensions/extension_manifest_constants.h" |
16 #include "grit/generated_resources.h" | 16 #include "grit/generated_resources.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
18 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
19 | 19 |
| 20 using extensions::Extension; |
| 21 |
20 namespace keys = extension_manifest_keys; | 22 namespace keys = extension_manifest_keys; |
21 | 23 |
22 #if defined(OS_WIN) | 24 #if defined(OS_WIN) |
23 // http://crbug.com/106381 | 25 // http://crbug.com/106381 |
24 #define InstallUninstallGarbageCollect DISABLED_InstallUninstallGarbageCollect | 26 #define InstallUninstallGarbageCollect DISABLED_InstallUninstallGarbageCollect |
25 #endif | 27 #endif |
26 TEST(ExtensionFileUtil, InstallUninstallGarbageCollect) { | 28 TEST(ExtensionFileUtil, InstallUninstallGarbageCollect) { |
27 ScopedTempDir temp; | 29 ScopedTempDir temp; |
28 ASSERT_TRUE(temp.CreateUniqueTempDir()); | 30 ASSERT_TRUE(temp.CreateUniqueTempDir()); |
29 | 31 |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 EXPECT_FALSE(extension_file_util::ValidateExtension(extension, &error)); | 425 EXPECT_FALSE(extension_file_util::ValidateExtension(extension, &error)); |
424 EXPECT_EQ(l10n_util::GetStringFUTF8( | 426 EXPECT_EQ(l10n_util::GetStringFUTF8( |
425 IDS_EXTENSION_LOAD_BACKGROUND_SCRIPT_FAILED, | 427 IDS_EXTENSION_LOAD_BACKGROUND_SCRIPT_FAILED, |
426 ASCIIToUTF16("http://google.com/foo.js")), | 428 ASCIIToUTF16("http://google.com/foo.js")), |
427 error); | 429 error); |
428 } | 430 } |
429 | 431 |
430 // TODO(aa): More tests as motivation allows. Maybe steal some from | 432 // TODO(aa): More tests as motivation allows. Maybe steal some from |
431 // ExtensionService? Many of them could probably be tested here without the | 433 // ExtensionService? Many of them could probably be tested here without the |
432 // MessageLoop shenanigans. | 434 // MessageLoop shenanigans. |
OLD | NEW |