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

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

Issue 679273002: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "chrome/grit/generated_resources.h" 8 #include "chrome/grit/generated_resources.h"
9 #include "extensions/common/permissions/permissions_data.h" 9 #include "extensions/common/permissions/permissions_data.h"
10 #include "extensions/strings/grit/extensions_strings.h" 10 #include "extensions/strings/grit/extensions_strings.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 #include "ui/base/l10n/l10n_util.h" 12 #include "ui/base/l10n/l10n_util.h"
13 13
14 namespace extensions { 14 namespace extensions {
15 15
16 // Tests that ChromePermissionMessageProvider provides correct permission 16 // Tests that ChromePermissionMessageProvider provides correct permission
17 // messages for given permissions. 17 // messages for given permissions.
18 // NOTE: No extensions are created as part of these tests. Integration tests 18 // NOTE: No extensions are created as part of these tests. Integration tests
19 // that test the messages are generated properly for extensions can be found in 19 // that test the messages are generated properly for extensions can be found in
20 // chrome/browser/extensions/permission_messages_unittest.cc. 20 // chrome/browser/extensions/permission_messages_unittest.cc.
21 class ChromePermissionMessageProviderUnittest : public testing::Test { 21 class ChromePermissionMessageProviderUnittest : public testing::Test {
22 public: 22 public:
23 ChromePermissionMessageProviderUnittest() 23 ChromePermissionMessageProviderUnittest()
24 : message_provider_(new ChromePermissionMessageProvider()) {} 24 : message_provider_(new ChromePermissionMessageProvider()) {}
25 virtual ~ChromePermissionMessageProviderUnittest() {} 25 ~ChromePermissionMessageProviderUnittest() override {}
26 26
27 protected: 27 protected:
28 std::vector<base::string16> GetMessages(APIPermissionSet& permissions, 28 std::vector<base::string16> GetMessages(APIPermissionSet& permissions,
29 Manifest::Type type) { 29 Manifest::Type type) {
30 scoped_refptr<const PermissionSet> permission_set = new PermissionSet( 30 scoped_refptr<const PermissionSet> permission_set = new PermissionSet(
31 permissions, ManifestPermissionSet(), URLPatternSet(), URLPatternSet()); 31 permissions, ManifestPermissionSet(), URLPatternSet(), URLPatternSet());
32 return message_provider_->GetWarningMessages(permission_set.get(), type); 32 return message_provider_->GetWarningMessages(permission_set.get(), type);
33 } 33 }
34 34
35 private: 35 private:
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 permissions.insert(APIPermission::kTab); 93 permissions.insert(APIPermission::kTab);
94 permissions.insert(APIPermission::kTopSites); 94 permissions.insert(APIPermission::kTopSites);
95 messages = GetMessages(permissions, Manifest::TYPE_PLATFORM_APP); 95 messages = GetMessages(permissions, Manifest::TYPE_PLATFORM_APP);
96 ASSERT_EQ(1U, messages.size()); 96 ASSERT_EQ(1U, messages.size());
97 EXPECT_EQ( 97 EXPECT_EQ(
98 l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT_WARNING_HISTORY_READ), 98 l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT_WARNING_HISTORY_READ),
99 messages[0]); 99 messages[0]);
100 } 100 }
101 101
102 } // namespace extensions 102 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/common/extensions/manifest_tests/chrome_manifest_test.h ('k') | chrome/common/favicon/favicon_url_parser_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698