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

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

Issue 141743005: Extensions: Make it possible for permission parsing code to return a detailed error message. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 6 years, 10 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 if (!permission->FromValue(value.get())) 203 ASSERT_TRUE(permission->FromValue(value.get(), NULL));
204 NOTREACHED();
205 } 204 }
206 api_perm_set1_.insert(permission.release()); 205 api_perm_set1_.insert(permission.release());
207 206
208 api_perm_set2_.insert(APIPermission::kHistory); 207 api_perm_set2_.insert(APIPermission::kHistory);
209 208
210 AddPattern(&ehost_perm_set1_, "http://*.google.com/*"); 209 AddPattern(&ehost_perm_set1_, "http://*.google.com/*");
211 AddPattern(&ehost_perm_set1_, "http://example.com/*"); 210 AddPattern(&ehost_perm_set1_, "http://example.com/*");
212 AddPattern(&ehost_perm_set1_, "chrome://favicon/*"); 211 AddPattern(&ehost_perm_set1_, "chrome://favicon/*");
213 212
214 AddPattern(&ehost_perm_set2_, "https://*.google.com/*"); 213 AddPattern(&ehost_perm_set2_, "https://*.google.com/*");
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
846 845
847 private: 846 private:
848 scoped_refptr<const Extension> extension_a_; 847 scoped_refptr<const Extension> extension_a_;
849 scoped_refptr<const Extension> extension_b_; 848 scoped_refptr<const Extension> extension_b_;
850 scoped_refptr<const Extension> extension_c_; 849 scoped_refptr<const Extension> extension_c_;
851 }; 850 };
852 TEST_F(ExtensionPrefsBlacklistedExtensions, 851 TEST_F(ExtensionPrefsBlacklistedExtensions,
853 ExtensionPrefsBlacklistedExtensions) {} 852 ExtensionPrefsBlacklistedExtensions) {}
854 853
855 } // namespace extensions 854 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698