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

Side by Side Diff: chrome/common/extensions/permissions/permission_set_unittest.cc

Issue 522053002: Remove implicit conversion from scoped_refptr to T* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « no previous file | no next file » | 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/json/json_file_value_serializer.h" 6 #include "base/json/json_file_value_serializer.h"
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/common/chrome_paths.h" 10 #include "chrome/common/chrome_paths.h"
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 { 872 {
873 // All sites warning suppresses topSites warning. 873 // All sites warning suppresses topSites warning.
874 APIPermissionSet api_permissions; 874 APIPermissionSet api_permissions;
875 URLPatternSet hosts; 875 URLPatternSet hosts;
876 hosts.AddPattern(URLPattern(URLPattern::SCHEME_CHROMEUI, "*://*/*")); 876 hosts.AddPattern(URLPattern(URLPattern::SCHEME_CHROMEUI, "*://*/*"));
877 api_permissions.insert(APIPermission::kTopSites); 877 api_permissions.insert(APIPermission::kTopSites);
878 scoped_refptr<PermissionSet> permissions(new PermissionSet( 878 scoped_refptr<PermissionSet> permissions(new PermissionSet(
879 api_permissions, ManifestPermissionSet(), hosts, URLPatternSet())); 879 api_permissions, ManifestPermissionSet(), hosts, URLPatternSet()));
880 PermissionMessages messages = 880 PermissionMessages messages =
881 PermissionMessageProvider::Get()->GetPermissionMessages( 881 PermissionMessageProvider::Get()->GetPermissionMessages(
882 permissions, Manifest::TYPE_EXTENSION); 882 permissions.get(), Manifest::TYPE_EXTENSION);
883 EXPECT_EQ(1u, messages.size()); 883 EXPECT_EQ(1u, messages.size());
884 EXPECT_EQ(PermissionMessage::kHostsAll, messages[0].id()); 884 EXPECT_EQ(PermissionMessage::kHostsAll, messages[0].id());
885 } 885 }
886 { 886 {
887 // All sites warning suppresses declarativeWebRequest warning. 887 // All sites warning suppresses declarativeWebRequest warning.
888 APIPermissionSet api_permissions; 888 APIPermissionSet api_permissions;
889 URLPatternSet hosts; 889 URLPatternSet hosts;
890 hosts.AddPattern(URLPattern(URLPattern::SCHEME_CHROMEUI, "*://*/*")); 890 hosts.AddPattern(URLPattern(URLPattern::SCHEME_CHROMEUI, "*://*/*"));
891 api_permissions.insert(APIPermission::kDeclarativeWebRequest); 891 api_permissions.insert(APIPermission::kDeclarativeWebRequest);
892 scoped_refptr<PermissionSet> permissions(new PermissionSet( 892 scoped_refptr<PermissionSet> permissions(new PermissionSet(
(...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after
1814 scoped_refptr<const PermissionSet> permissions_dwr( 1814 scoped_refptr<const PermissionSet> permissions_dwr(
1815 extension_dwr->permissions_data()->active_permissions()); 1815 extension_dwr->permissions_data()->active_permissions());
1816 1816
1817 EXPECT_FALSE(PermissionMessageProvider::Get()-> 1817 EXPECT_FALSE(PermissionMessageProvider::Get()->
1818 IsPrivilegeIncrease(permissions.get(), 1818 IsPrivilegeIncrease(permissions.get(),
1819 permissions_dwr.get(), 1819 permissions_dwr.get(),
1820 extension->GetType())); 1820 extension->GetType()));
1821 } 1821 }
1822 1822
1823 } // namespace extensions 1823 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698