| 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/ref_counted.h" | 5 #include "base/memory/ref_counted.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/extensions/extension_service_test_base.h" | 10 #include "chrome/browser/extensions/extension_service_test_base.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 } // namespace | 48 } // namespace |
| 49 | 49 |
| 50 class SharedModuleServiceUnitTest : public ExtensionServiceTestBase { | 50 class SharedModuleServiceUnitTest : public ExtensionServiceTestBase { |
| 51 public: | 51 public: |
| 52 SharedModuleServiceUnitTest() : | 52 SharedModuleServiceUnitTest() : |
| 53 // The "export" key is open for dev-channel only, but unit tests | 53 // The "export" key is open for dev-channel only, but unit tests |
| 54 // run as stable channel on the official Windows build. | 54 // run as stable channel on the official Windows build. |
| 55 current_channel_(chrome::VersionInfo::CHANNEL_UNKNOWN) {} | 55 current_channel_(chrome::VersionInfo::CHANNEL_UNKNOWN) {} |
| 56 protected: | 56 protected: |
| 57 virtual void SetUp() OVERRIDE; | 57 virtual void SetUp() override; |
| 58 | 58 |
| 59 // Install an extension and notify the ExtensionService. | 59 // Install an extension and notify the ExtensionService. |
| 60 testing::AssertionResult InstallExtension(const Extension* extension, | 60 testing::AssertionResult InstallExtension(const Extension* extension, |
| 61 bool is_update); | 61 bool is_update); |
| 62 ScopedCurrentChannel current_channel_; | 62 ScopedCurrentChannel current_channel_; |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 void SharedModuleServiceUnitTest::SetUp() { | 65 void SharedModuleServiceUnitTest::SetUp() { |
| 66 ExtensionServiceTestBase::SetUp(); | 66 ExtensionServiceTestBase::SetUp(); |
| 67 InitializeGoodInstalledExtensionService(); | 67 InitializeGoodInstalledExtensionService(); |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 nonwhitelisted_id, | 269 nonwhitelisted_id, |
| 270 "1.0"); | 270 "1.0"); |
| 271 // This should succeed because only CRX installer (and by extension the | 271 // This should succeed because only CRX installer (and by extension the |
| 272 // WebStore Installer) checks the shared module whitelist. InstallExtension | 272 // WebStore Installer) checks the shared module whitelist. InstallExtension |
| 273 // bypasses the whitelist check because the SharedModuleService does not | 273 // bypasses the whitelist check because the SharedModuleService does not |
| 274 // care about whitelists. | 274 // care about whitelists. |
| 275 EXPECT_TRUE(InstallExtension(nonwhitelisted_extension.get(), false)); | 275 EXPECT_TRUE(InstallExtension(nonwhitelisted_extension.get(), false)); |
| 276 } | 276 } |
| 277 | 277 |
| 278 } // namespace extensions | 278 } // namespace extensions |
| OLD | NEW |