OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/manifest_tests/extension_manifest_test.h" | 5 #include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h" |
6 #include "extensions/common/manifest_constants.h" | 6 #include "extensions/common/manifest_constants.h" |
7 #include "extensions/common/manifest_handlers/file_handler_info.h" | 7 #include "extensions/common/manifest_handlers/file_handler_info.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace extensions { | 10 namespace extensions { |
11 | 11 |
12 namespace errors = manifest_errors; | 12 namespace errors = manifest_errors; |
13 | 13 |
14 class FileHandlersManifestTest : public ExtensionManifestTest { | 14 // TODO(jamescook): Convert from ChromeManifestTest to ManifestTest. |
| 15 class FileHandlersManifestTest : public ChromeManifestTest { |
15 }; | 16 }; |
16 | 17 |
17 TEST_F(FileHandlersManifestTest, InvalidFileHandlers) { | 18 TEST_F(FileHandlersManifestTest, InvalidFileHandlers) { |
18 Testcase testcases[] = { | 19 Testcase testcases[] = { |
19 Testcase("file_handlers_invalid_handlers.json", | 20 Testcase("file_handlers_invalid_handlers.json", |
20 errors::kInvalidFileHandlers), | 21 errors::kInvalidFileHandlers), |
21 Testcase("file_handlers_invalid_type.json", | 22 Testcase("file_handlers_invalid_type.json", |
22 errors::kInvalidFileHandlerType), | 23 errors::kInvalidFileHandlerType), |
23 Testcase("file_handlers_invalid_extension.json", | 24 Testcase("file_handlers_invalid_extension.json", |
24 errors::kInvalidFileHandlerExtension), | 25 errors::kInvalidFileHandlerExtension), |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 scoped_refptr<const Extension> extension = | 65 scoped_refptr<const Extension> extension = |
65 LoadAndExpectSuccess("file_handlers_invalid_not_app.json"); | 66 LoadAndExpectSuccess("file_handlers_invalid_not_app.json"); |
66 | 67 |
67 ASSERT_TRUE(extension.get()); | 68 ASSERT_TRUE(extension.get()); |
68 const FileHandlersInfo* handlers = | 69 const FileHandlersInfo* handlers = |
69 FileHandlers::GetFileHandlers(extension.get()); | 70 FileHandlers::GetFileHandlers(extension.get()); |
70 ASSERT_TRUE(handlers == NULL); | 71 ASSERT_TRUE(handlers == NULL); |
71 } | 72 } |
72 | 73 |
73 } // namespace extensions | 74 } // namespace extensions |
OLD | NEW |