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

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: Merged out Created 8 years, 9 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
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 986 matching lines...) Expand 10 before | Expand all | Expand 10 after
997 errors::kInvalidFileFiltersList); 997 errors::kInvalidFileFiltersList);
998 LoadAndExpectError("filebrowser_invalid_file_filters_2.json", 998 LoadAndExpectError("filebrowser_invalid_file_filters_2.json",
999 ExtensionErrorUtils::FormatErrorMessage( 999 ExtensionErrorUtils::FormatErrorMessage(
1000 errors::kInvalidFileFilterValue, base::IntToString(0))); 1000 errors::kInvalidFileFilterValue, base::IntToString(0)));
1001 LoadAndExpectError("filebrowser_invalid_file_filters_url.json", 1001 LoadAndExpectError("filebrowser_invalid_file_filters_url.json",
1002 ExtensionErrorUtils::FormatErrorMessage(errors::kInvalidURLPatternError, 1002 ExtensionErrorUtils::FormatErrorMessage(errors::kInvalidURLPatternError,
1003 "http:*.html")); 1003 "http:*.html"));
1004 1004
1005 scoped_refptr<Extension> extension( 1005 scoped_refptr<Extension> extension(
1006 LoadAndExpectSuccess("filebrowser_valid.json")); 1006 LoadAndExpectSuccess("filebrowser_valid.json"));
1007 ASSERT_TRUE(extension.get());
1007 ASSERT_TRUE(extension->file_browser_handlers() != NULL); 1008 ASSERT_TRUE(extension->file_browser_handlers() != NULL);
1008 ASSERT_EQ(extension->file_browser_handlers()->size(), 1U); 1009 ASSERT_EQ(extension->file_browser_handlers()->size(), 1U);
1009 const FileBrowserHandler* action = 1010 const FileBrowserHandler* action =
1010 extension->file_browser_handlers()->at(0).get(); 1011 extension->file_browser_handlers()->at(0).get();
1011 EXPECT_EQ(action->title(), "Default title"); 1012 EXPECT_EQ(action->title(), "Default title");
1012 EXPECT_EQ(action->icon_path(), "icon.png"); 1013 EXPECT_EQ(action->icon_path(), "icon.png");
1013 const URLPatternSet& patterns = action->file_url_patterns(); 1014 const URLPatternSet& patterns = action->file_url_patterns();
1014 ASSERT_EQ(patterns.patterns().size(), 1U); 1015 ASSERT_EQ(patterns.patterns().size(), 1U);
1015 ASSERT_TRUE(action->MatchesURL( 1016 ASSERT_TRUE(action->MatchesURL(
1016 GURL("filesystem:chrome-extension://foo/local/test.txt"))); 1017 GURL("filesystem:chrome-extension://foo/local/test.txt")));
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
1118 EXPECT_EQ("", extension->page_action()->id()); 1119 EXPECT_EQ("", extension->page_action()->id());
1119 EXPECT_EQ(0u, extension->page_action()->icon_paths()->size()); 1120 EXPECT_EQ(0u, extension->page_action()->icon_paths()->size());
1120 EXPECT_EQ("", extension->page_action()->GetTitle( 1121 EXPECT_EQ("", extension->page_action()->GetTitle(
1121 ExtensionAction::kDefaultTabId)); 1122 ExtensionAction::kDefaultTabId));
1122 EXPECT_FALSE(extension->page_action()->HasPopup( 1123 EXPECT_FALSE(extension->page_action()->HasPopup(
1123 ExtensionAction::kDefaultTabId)); 1124 ExtensionAction::kDefaultTabId));
1124 1125
1125 LoadAndExpectError("page_action_manifest_version_2b.json", 1126 LoadAndExpectError("page_action_manifest_version_2b.json",
1126 errors::kInvalidPageActionPopup); 1127 errors::kInvalidPageActionPopup);
1127 } 1128 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698