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

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

Issue 1349613003: [Extensions] Un-refcount PermissionSet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/permissions/chrome_permission_message_provide r.h" 5 #include "chrome/common/extensions/permissions/chrome_permission_message_provide r.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 16 matching lines...) Expand all
27 // chrome/browser/extensions/permission_messages_unittest.cc. 27 // chrome/browser/extensions/permission_messages_unittest.cc.
28 class ChromePermissionMessageProviderUnittest : public testing::Test { 28 class ChromePermissionMessageProviderUnittest : public testing::Test {
29 public: 29 public:
30 ChromePermissionMessageProviderUnittest() 30 ChromePermissionMessageProviderUnittest()
31 : message_provider_(new ChromePermissionMessageProvider()) {} 31 : message_provider_(new ChromePermissionMessageProvider()) {}
32 ~ChromePermissionMessageProviderUnittest() override {} 32 ~ChromePermissionMessageProviderUnittest() override {}
33 33
34 protected: 34 protected:
35 PermissionMessages GetMessages(const APIPermissionSet& permissions, 35 PermissionMessages GetMessages(const APIPermissionSet& permissions,
36 Manifest::Type type) { 36 Manifest::Type type) {
37 scoped_refptr<const PermissionSet> permission_set = new PermissionSet( 37 PermissionSet permission_set(permissions, ManifestPermissionSet(),
38 permissions, ManifestPermissionSet(), URLPatternSet(), URLPatternSet()); 38 URLPatternSet(), URLPatternSet());
39 return message_provider_->GetPermissionMessages( 39 return message_provider_->GetPermissionMessages(
40 message_provider_->GetAllPermissionIDs(permission_set.get(), type)); 40 message_provider_->GetAllPermissionIDs(&permission_set, type));
41 } 41 }
42 42
43 private: 43 private:
44 scoped_ptr<ChromePermissionMessageProvider> message_provider_; 44 scoped_ptr<ChromePermissionMessageProvider> message_provider_;
45 45
46 DISALLOW_COPY_AND_ASSIGN(ChromePermissionMessageProviderUnittest); 46 DISALLOW_COPY_AND_ASSIGN(ChromePermissionMessageProviderUnittest);
47 }; 47 };
48 48
49 // Checks that if an app has a superset and a subset permission, only the 49 // Checks that if an app has a superset and a subset permission, only the
50 // superset permission message is displayed if they are both present. 50 // superset permission message is displayed if they are both present.
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 message0.message()); 112 message0.message());
113 EXPECT_TRUE(message0.submessages().empty()); 113 EXPECT_TRUE(message0.submessages().empty());
114 const PermissionMessage& message1 = *it++; 114 const PermissionMessage& message1 = *it++;
115 EXPECT_EQ( 115 EXPECT_EQ(
116 l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT_WARNING_USB_DEVICE_LIST), 116 l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT_WARNING_USB_DEVICE_LIST),
117 message1.message()); 117 message1.message());
118 EXPECT_FALSE(message1.submessages().empty()); 118 EXPECT_FALSE(message1.submessages().empty());
119 } 119 }
120 120
121 } // namespace extensions 121 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698