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

Side by Side Diff: chrome/browser/extensions/extension_prefs_unittest.cc

Issue 221353003: Make unknown extension subpermissions warnings instead of errors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 6 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) 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/browser/extensions/./extension_prefs_unittest.h" 5 #include "chrome/browser/extensions/./extension_prefs_unittest.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/prefs/mock_pref_change_callback.h" 10 #include "base/prefs/mock_pref_change_callback.h"
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 193
194 api_perm_set1_.insert(APIPermission::kTab); 194 api_perm_set1_.insert(APIPermission::kTab);
195 api_perm_set1_.insert(APIPermission::kBookmark); 195 api_perm_set1_.insert(APIPermission::kBookmark);
196 scoped_ptr<APIPermission> permission( 196 scoped_ptr<APIPermission> permission(
197 permission_info->CreateAPIPermission()); 197 permission_info->CreateAPIPermission());
198 { 198 {
199 scoped_ptr<base::ListValue> value(new base::ListValue()); 199 scoped_ptr<base::ListValue> value(new base::ListValue());
200 value->Append(new base::StringValue("tcp-connect:*.example.com:80")); 200 value->Append(new base::StringValue("tcp-connect:*.example.com:80"));
201 value->Append(new base::StringValue("udp-bind::8080")); 201 value->Append(new base::StringValue("udp-bind::8080"));
202 value->Append(new base::StringValue("udp-send-to::8888")); 202 value->Append(new base::StringValue("udp-send-to::8888"));
203 ASSERT_TRUE(permission->FromValue(value.get(), NULL)); 203 ASSERT_TRUE(permission->FromValue(value.get(), NULL, NULL));
204 } 204 }
205 api_perm_set1_.insert(permission.release()); 205 api_perm_set1_.insert(permission.release());
206 206
207 api_perm_set2_.insert(APIPermission::kHistory); 207 api_perm_set2_.insert(APIPermission::kHistory);
208 208
209 AddPattern(&ehost_perm_set1_, "http://*.google.com/*"); 209 AddPattern(&ehost_perm_set1_, "http://*.google.com/*");
210 AddPattern(&ehost_perm_set1_, "http://example.com/*"); 210 AddPattern(&ehost_perm_set1_, "http://example.com/*");
211 AddPattern(&ehost_perm_set1_, "chrome://favicon/*"); 211 AddPattern(&ehost_perm_set1_, "chrome://favicon/*");
212 212
213 AddPattern(&ehost_perm_set2_, "https://*.google.com/*"); 213 AddPattern(&ehost_perm_set2_, "https://*.google.com/*");
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
905 EXPECT_FALSE(prefs()->IsExtensionBlacklisted(extension_a_->id())); 905 EXPECT_FALSE(prefs()->IsExtensionBlacklisted(extension_a_->id()));
906 EXPECT_EQ(empty_ids, prefs()->GetBlacklistedExtensions()); 906 EXPECT_EQ(empty_ids, prefs()->GetBlacklistedExtensions());
907 } 907 }
908 908
909 private: 909 private:
910 scoped_refptr<const Extension> extension_a_; 910 scoped_refptr<const Extension> extension_a_;
911 }; 911 };
912 TEST_F(ExtensionPrefsBlacklistState, ExtensionPrefsBlacklistState) {} 912 TEST_F(ExtensionPrefsBlacklistState, ExtensionPrefsBlacklistState) {}
913 913
914 } // namespace extensions 914 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698