| OLD | NEW |
| 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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
| 6 #include "chrome/browser/extensions/extension_service.h" | 6 #include "chrome/browser/extensions/extension_service.h" |
| 7 #include "chrome/browser/extensions/extension_service_test_base.h" | 7 #include "chrome/browser/extensions/extension_service_test_base.h" |
| 8 #include "chrome/browser/extensions/permissions_updater.h" | 8 #include "chrome/browser/extensions/permissions_updater.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/common/extensions/permissions/chrome_permission_message_provide
r.h" | 10 #include "chrome/common/extensions/permissions/chrome_permission_message_provide
r.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 // problematic functionality. These tests are prefixed with AntiTest_ and will | 35 // problematic functionality. These tests are prefixed with AntiTest_ and will |
| 36 // be changed as the correct behaviour is implemented. TODOs in the test explain | 36 // be changed as the correct behaviour is implemented. TODOs in the test explain |
| 37 // the currently problematic behaviour. | 37 // the currently problematic behaviour. |
| 38 class PermissionMessagesUnittest : public ExtensionServiceTestBase { | 38 class PermissionMessagesUnittest : public ExtensionServiceTestBase { |
| 39 public: | 39 public: |
| 40 PermissionMessagesUnittest() | 40 PermissionMessagesUnittest() |
| 41 : message_provider_(new ChromePermissionMessageProvider()) {} | 41 : message_provider_(new ChromePermissionMessageProvider()) {} |
| 42 virtual ~PermissionMessagesUnittest() {} | 42 virtual ~PermissionMessagesUnittest() {} |
| 43 | 43 |
| 44 // Overridden from testing::Test: | 44 // Overridden from testing::Test: |
| 45 virtual void SetUp() OVERRIDE { | 45 virtual void SetUp() override { |
| 46 ExtensionServiceTestBase::SetUp(); | 46 ExtensionServiceTestBase::SetUp(); |
| 47 InitializeExtensionService(CreateDefaultInitParams()); | 47 InitializeExtensionService(CreateDefaultInitParams()); |
| 48 InitializeProcessManager(); | 48 InitializeProcessManager(); |
| 49 } | 49 } |
| 50 | 50 |
| 51 protected: | 51 protected: |
| 52 void CreateAndInstallAppWithPermissions(ListBuilder& required_permissions, | 52 void CreateAndInstallAppWithPermissions(ListBuilder& required_permissions, |
| 53 ListBuilder& optional_permissions) { | 53 ListBuilder& optional_permissions) { |
| 54 app_ = test_util::BuildApp(ExtensionBuilder().Pass()) | 54 app_ = test_util::BuildApp(ExtensionBuilder().Pass()) |
| 55 .MergeManifest( | 55 .MergeManifest( |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 | 264 |
| 265 GrantOptionalPermissions(); | 265 GrantOptionalPermissions(); |
| 266 | 266 |
| 267 ASSERT_EQ(1U, active_permissions().size()); | 267 ASSERT_EQ(1U, active_permissions().size()); |
| 268 EXPECT_EQ(l10n_util::GetStringUTF16( | 268 EXPECT_EQ(l10n_util::GetStringUTF16( |
| 269 IDS_EXTENSION_PROMPT_WARNING_HISTORY_READ_AND_SESSIONS), | 269 IDS_EXTENSION_PROMPT_WARNING_HISTORY_READ_AND_SESSIONS), |
| 270 active_permissions()[0]); | 270 active_permissions()[0]); |
| 271 } | 271 } |
| 272 | 272 |
| 273 } // namespace extensions | 273 } // namespace extensions |
| OLD | NEW |