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.h" | 5 #include "chrome/common/extensions/extension.h" |
6 | 6 |
7 #if defined(TOOLKIT_GTK) | 7 #if defined(TOOLKIT_GTK) |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1088 errors::kInvalidFileFiltersList); | 1088 errors::kInvalidFileFiltersList); |
1089 LoadAndExpectError("filebrowser_invalid_file_filters_2.json", | 1089 LoadAndExpectError("filebrowser_invalid_file_filters_2.json", |
1090 ExtensionErrorUtils::FormatErrorMessage( | 1090 ExtensionErrorUtils::FormatErrorMessage( |
1091 errors::kInvalidFileFilterValue, base::IntToString(0))); | 1091 errors::kInvalidFileFilterValue, base::IntToString(0))); |
1092 LoadAndExpectError("filebrowser_invalid_file_filters_url.json", | 1092 LoadAndExpectError("filebrowser_invalid_file_filters_url.json", |
1093 ExtensionErrorUtils::FormatErrorMessage(errors::kInvalidURLPatternError, | 1093 ExtensionErrorUtils::FormatErrorMessage(errors::kInvalidURLPatternError, |
1094 "http:*.html")); | 1094 "http:*.html")); |
1095 | 1095 |
1096 scoped_refptr<Extension> extension( | 1096 scoped_refptr<Extension> extension( |
1097 LoadAndExpectSuccess("filebrowser_valid.json")); | 1097 LoadAndExpectSuccess("filebrowser_valid.json")); |
| 1098 ASSERT_TRUE(extension.get()); |
1098 ASSERT_TRUE(extension->file_browser_handlers() != NULL); | 1099 ASSERT_TRUE(extension->file_browser_handlers() != NULL); |
1099 ASSERT_EQ(extension->file_browser_handlers()->size(), 1U); | 1100 ASSERT_EQ(extension->file_browser_handlers()->size(), 1U); |
1100 const FileBrowserHandler* action = | 1101 const FileBrowserHandler* action = |
1101 extension->file_browser_handlers()->at(0).get(); | 1102 extension->file_browser_handlers()->at(0).get(); |
1102 EXPECT_EQ(action->title(), "Default title"); | 1103 EXPECT_EQ(action->title(), "Default title"); |
1103 EXPECT_EQ(action->icon_path(), "icon.png"); | 1104 EXPECT_EQ(action->icon_path(), "icon.png"); |
1104 const URLPatternSet& patterns = action->file_url_patterns(); | 1105 const URLPatternSet& patterns = action->file_url_patterns(); |
1105 ASSERT_EQ(patterns.patterns().size(), 1U); | 1106 ASSERT_EQ(patterns.patterns().size(), 1U); |
1106 ASSERT_TRUE(action->MatchesURL( | 1107 ASSERT_TRUE(action->MatchesURL( |
1107 GURL("filesystem:chrome-extension://foo/local/test.txt"))); | 1108 GURL("filesystem:chrome-extension://foo/local/test.txt"))); |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1269 // Extension with manifest version 2 *can* use storage API. | 1270 // Extension with manifest version 2 *can* use storage API. |
1270 { | 1271 { |
1271 DictionaryValue manifest_with_version; | 1272 DictionaryValue manifest_with_version; |
1272 manifest_with_version.SetInteger(keys::kManifestVersion, 2); | 1273 manifest_with_version.SetInteger(keys::kManifestVersion, 2); |
1273 manifest_with_version.MergeDictionary(&base_manifest); | 1274 manifest_with_version.MergeDictionary(&base_manifest); |
1274 | 1275 |
1275 Manifest manifest(&manifest_with_version, "test"); | 1276 Manifest manifest(&manifest_with_version, "test"); |
1276 LoadAndExpectSuccess(manifest); | 1277 LoadAndExpectSuccess(manifest); |
1277 } | 1278 } |
1278 } | 1279 } |
OLD | NEW |