Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: chrome/common/extensions/extension_manifests_unittest.cc

Issue 7811006: Add full support for filesystem URLs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge errors Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/extensions/extension.cc ('k') | chrome/common/extensions/url_pattern.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension.cc ('k') | chrome/common/extensions/url_pattern.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698