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

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

Issue 6683060: Private API for extensions like ssh-client that need access to TCP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: m Created 9 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 975 matching lines...) Expand 10 before | Expand all | Expand 10 after
986 // so we won't prompt for it for now. 986 // so we won't prompt for it for now.
987 skip.insert(Extension::kFileSystemPermission); 987 skip.insert(Extension::kFileSystemPermission);
988 988
989 // If you've turned on the experimental command-line flag, we don't need 989 // If you've turned on the experimental command-line flag, we don't need
990 // to warn you further. 990 // to warn you further.
991 skip.insert(Extension::kExperimentalPermission); 991 skip.insert(Extension::kExperimentalPermission);
992 992
993 // These are only usable by component extensions. 993 // These are only usable by component extensions.
994 skip.insert(Extension::kWebstorePrivatePermission); 994 skip.insert(Extension::kWebstorePrivatePermission);
995 skip.insert(Extension::kFileBrowserPrivatePermission); 995 skip.insert(Extension::kFileBrowserPrivatePermission);
996 skip.insert(Extension::kChromeosInfoPrivatePermissions); 996 skip.insert(Extension::kChromeosInfoPrivatePermission);
997 skip.insert(Extension::kWebproxyPrivatePermission);
997 998
998 for (size_t i = 0; i < Extension::kNumPermissions; ++i) { 999 for (size_t i = 0; i < Extension::kNumPermissions; ++i) {
999 int message_id = Extension::kPermissions[i].message_id; 1000 int message_id = Extension::kPermissions[i].message_id;
1000 std::string name = Extension::kPermissions[i].name; 1001 std::string name = Extension::kPermissions[i].name;
1001 if (skip.count(name)) 1002 if (skip.count(name))
1002 EXPECT_EQ(0, message_id) << "unexpected message_id for " << name; 1003 EXPECT_EQ(0, message_id) << "unexpected message_id for " << name;
1003 else 1004 else
1004 EXPECT_NE(0, message_id) << "missing message_id for " << name; 1005 EXPECT_NE(0, message_id) << "missing message_id for " << name;
1005 } 1006 }
1006 } 1007 }
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
1494 EXPECT_TRUE(Extension::GenerateId("test", &result)); 1495 EXPECT_TRUE(Extension::GenerateId("test", &result));
1495 EXPECT_EQ(result, "jpignaibiiemhngfjkcpokkamffknabf"); 1496 EXPECT_EQ(result, "jpignaibiiemhngfjkcpokkamffknabf");
1496 1497
1497 EXPECT_TRUE(Extension::GenerateId("_", &result)); 1498 EXPECT_TRUE(Extension::GenerateId("_", &result));
1498 EXPECT_EQ(result, "ncocknphbhhlhkikpnnlmbcnbgdempcd"); 1499 EXPECT_EQ(result, "ncocknphbhhlhkikpnnlmbcnbgdempcd");
1499 1500
1500 EXPECT_TRUE(Extension::GenerateId( 1501 EXPECT_TRUE(Extension::GenerateId(
1501 "this_string_is_longer_than_a_single_sha256_hash_digest", &result)); 1502 "this_string_is_longer_than_a_single_sha256_hash_digest", &result));
1502 EXPECT_EQ(result, "jimneklojkjdibfkgiiophfhjhbdgcfi"); 1503 EXPECT_EQ(result, "jimneklojkjdibfkgiiophfhjhbdgcfi");
1503 } 1504 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698