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 "base/files/file_path.h" | 5 #include "base/files/file_path.h" |
6 #include "base/files/scoped_temp_dir.h" | 6 #include "base/files/scoped_temp_dir.h" |
7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "chrome/browser/extensions/api/management/management_api.h" | 9 #include "chrome/browser/extensions/api/management/management_api.h" |
10 #include "chrome/browser/extensions/api/management/management_api_constants.h" | 10 #include "chrome/browser/extensions/api/management/management_api_constants.h" |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 ASSERT_TRUE(result->GetAsList(&list)); | 208 ASSERT_TRUE(result->GetAsList(&list)); |
209 EXPECT_EQ(1U, list->GetSize()); | 209 EXPECT_EQ(1U, list->GetSize()); |
210 } | 210 } |
211 | 211 |
212 class ExtensionManagementApiEscalationTest : | 212 class ExtensionManagementApiEscalationTest : |
213 public ExtensionManagementApiBrowserTest { | 213 public ExtensionManagementApiBrowserTest { |
214 protected: | 214 protected: |
215 // The id of the permissions escalation test extension we use. | 215 // The id of the permissions escalation test extension we use. |
216 static const char kId[]; | 216 static const char kId[]; |
217 | 217 |
218 virtual void SetUpOnMainThread() OVERRIDE { | 218 virtual void SetUpOnMainThread() override { |
219 EXPECT_TRUE(scoped_temp_dir_.CreateUniqueTempDir()); | 219 EXPECT_TRUE(scoped_temp_dir_.CreateUniqueTempDir()); |
220 base::FilePath pem_path = test_data_dir_. | 220 base::FilePath pem_path = test_data_dir_. |
221 AppendASCII("permissions_increase").AppendASCII("permissions.pem"); | 221 AppendASCII("permissions_increase").AppendASCII("permissions.pem"); |
222 base::FilePath path_v1 = PackExtensionWithOptions( | 222 base::FilePath path_v1 = PackExtensionWithOptions( |
223 test_data_dir_.AppendASCII("permissions_increase").AppendASCII("v1"), | 223 test_data_dir_.AppendASCII("permissions_increase").AppendASCII("v1"), |
224 scoped_temp_dir_.path().AppendASCII("permissions1.crx"), | 224 scoped_temp_dir_.path().AppendASCII("permissions1.crx"), |
225 pem_path, | 225 pem_path, |
226 base::FilePath()); | 226 base::FilePath()); |
227 base::FilePath path_v2 = PackExtensionWithOptions( | 227 base::FilePath path_v2 = PackExtensionWithOptions( |
228 test_data_dir_.AppendASCII("permissions_increase").AppendASCII("v2"), | 228 test_data_dir_.AppendASCII("permissions_increase").AppendASCII("v2"), |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 // extension should be reloaded and enabled. | 316 // extension should be reloaded and enabled. |
317 ASSERT_TRUE(CrashEnabledExtension(kId)); | 317 ASSERT_TRUE(CrashEnabledExtension(kId)); |
318 SetEnabled(false, true, std::string()); | 318 SetEnabled(false, true, std::string()); |
319 SetEnabled(true, true, std::string()); | 319 SetEnabled(true, true, std::string()); |
320 const Extension* extension = ExtensionSystem::Get(browser()->profile()) | 320 const Extension* extension = ExtensionSystem::Get(browser()->profile()) |
321 ->extension_service()->GetExtensionById(kId, false); | 321 ->extension_service()->GetExtensionById(kId, false); |
322 EXPECT_TRUE(extension); | 322 EXPECT_TRUE(extension); |
323 } | 323 } |
324 | 324 |
325 } // namespace extensions | 325 } // namespace extensions |
OLD | NEW |