OLD | NEW |
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 "chrome/browser/extensions/crx_installer.h" | 5 #include "chrome/browser/extensions/crx_installer.h" |
6 | 6 |
7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 void CheckHasEmptyScopesAfterInstall(const std::string& ext_relpath, | 242 void CheckHasEmptyScopesAfterInstall(const std::string& ext_relpath, |
243 bool record_oauth2_grant) { | 243 bool record_oauth2_grant) { |
244 ScopedExperimentalCommandLine scope; | 244 ScopedExperimentalCommandLine scope; |
245 | 245 |
246 scoped_refptr<MockPromptProxy> mock_prompt = | 246 scoped_refptr<MockPromptProxy> mock_prompt = |
247 CreateMockPromptProxyForBrowser(browser()); | 247 CreateMockPromptProxyForBrowser(browser()); |
248 | 248 |
249 mock_prompt->set_record_oauth2_grant(record_oauth2_grant); | 249 mock_prompt->set_record_oauth2_grant(record_oauth2_grant); |
250 InstallWithPrompt("browsertest/scopes", std::string(), mock_prompt); | 250 InstallWithPrompt("browsertest/scopes", std::string(), mock_prompt); |
251 | 251 |
252 scoped_refptr<const PermissionSet> permissions = | 252 scoped_ptr<const PermissionSet> permissions = |
253 ExtensionPrefs::Get(browser()->profile()) | 253 ExtensionPrefs::Get(browser()->profile()) |
254 ->GetGrantedPermissions(mock_prompt->extension_id()); | 254 ->GetGrantedPermissions(mock_prompt->extension_id()); |
255 ASSERT_TRUE(permissions.get()); | 255 ASSERT_TRUE(permissions.get()); |
256 } | 256 } |
257 | 257 |
258 // Returns a FilePath to an unpacked "experimental" extension (a test | 258 // Returns a FilePath to an unpacked "experimental" extension (a test |
259 // Extension which requests the "experimental" permission). | 259 // Extension which requests the "experimental" permission). |
260 base::FilePath PackExperimentalExtension() { | 260 base::FilePath PackExperimentalExtension() { |
261 // We must modify the command line temporarily in order to pack an | 261 // We must modify the command line temporarily in order to pack an |
262 // extension that requests the experimental permission. | 262 // extension that requests the experimental permission. |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 ManagementPolicyMock policy; | 591 ManagementPolicyMock policy; |
592 extensions::ExtensionSystem::Get(profile()) | 592 extensions::ExtensionSystem::Get(profile()) |
593 ->management_policy() | 593 ->management_policy() |
594 ->RegisterProvider(&policy); | 594 ->RegisterProvider(&policy); |
595 | 595 |
596 base::FilePath crx_path = test_data_dir_.AppendASCII("crx_installer/v1.crx"); | 596 base::FilePath crx_path = test_data_dir_.AppendASCII("crx_installer/v1.crx"); |
597 EXPECT_FALSE(InstallExtension(crx_path, 0)); | 597 EXPECT_FALSE(InstallExtension(crx_path, 0)); |
598 } | 598 } |
599 | 599 |
600 } // namespace extensions | 600 } // namespace extensions |
OLD | NEW |