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/manifest_tests/extension_manifest_test.h" | 5 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" |
6 | 6 |
7 #include "base/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
8 #include "chrome/common/extensions/extension.h" | 8 #include "chrome/common/extensions/extension.h" |
9 #include "chrome/common/extensions/extension_error_utils.h" | 9 #include "chrome/common/extensions/extension_error_utils.h" |
10 #include "chrome/common/extensions/extension_manifest_constants.h" | 10 #include "chrome/common/extensions/extension_manifest_constants.h" |
11 #include "chrome/common/extensions/file_browser_handler.h" | 11 #include "chrome/common/extensions/file_browser_handler.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
| 14 using extensions::Extension; |
| 15 |
14 namespace errors = extension_manifest_errors; | 16 namespace errors = extension_manifest_errors; |
15 | 17 |
16 TEST_F(ExtensionManifestTest, FileBrowserHandlers) { | 18 TEST_F(ExtensionManifestTest, FileBrowserHandlers) { |
17 Testcase testcases[] = { | 19 Testcase testcases[] = { |
18 Testcase("filebrowser_invalid_access_permission.json", | 20 Testcase("filebrowser_invalid_access_permission.json", |
19 ExtensionErrorUtils::FormatErrorMessage( | 21 ExtensionErrorUtils::FormatErrorMessage( |
20 errors::kInvalidFileAccessValue, base::IntToString(1))), | 22 errors::kInvalidFileAccessValue, base::IntToString(1))), |
21 Testcase("filebrowser_invalid_access_permission_list.json", | 23 Testcase("filebrowser_invalid_access_permission_list.json", |
22 errors::kInvalidFileAccessList), | 24 errors::kInvalidFileAccessList), |
23 Testcase("filebrowser_invalid_empty_access_permission_list.json", | 25 Testcase("filebrowser_invalid_empty_access_permission_list.json", |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 #if defined(FILE_MANAGER_EXTENSION) | 86 #if defined(FILE_MANAGER_EXTENSION) |
85 EXPECT_EQ("", error); | 87 EXPECT_EQ("", error); |
86 #else | 88 #else |
87 EXPECT_EQ(std::string(errors::kInvalidChromeURLOverrides), error); | 89 EXPECT_EQ(std::string(errors::kInvalidChromeURLOverrides), error); |
88 #endif | 90 #endif |
89 | 91 |
90 // Extensions of other types can't ovverride chrome://files/ URL. | 92 // Extensions of other types can't ovverride chrome://files/ URL. |
91 LoadAndExpectError("filebrowser_url_override.json", | 93 LoadAndExpectError("filebrowser_url_override.json", |
92 errors::kInvalidChromeURLOverrides); | 94 errors::kInvalidChromeURLOverrides); |
93 } | 95 } |
OLD | NEW |