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

Side by Side Diff: chrome/browser/extensions/api/management/management_api_browsertest.cc

Issue 12494028: Move Requirements out of Extension Class (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 9 months 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 (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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/files/file_path.h" 6 #include "base/files/file_path.h"
7 #include "base/files/scoped_temp_dir.h" 7 #include "base/files/scoped_temp_dir.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "chrome/browser/extensions/api/management/management_api.h" 10 #include "chrome/browser/extensions/api/management/management_api.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 EXPECT_EQ(1U, list->GetSize()); 163 EXPECT_EQ(1U, list->GetSize());
164 } 164 }
165 165
166 class ExtensionManagementApiEscalationTest : 166 class ExtensionManagementApiEscalationTest :
167 public ExtensionManagementApiBrowserTest { 167 public ExtensionManagementApiBrowserTest {
168 protected: 168 protected:
169 // The id of the permissions escalation test extension we use. 169 // The id of the permissions escalation test extension we use.
170 static const char kId[]; 170 static const char kId[];
171 171
172 virtual void SetUpOnMainThread() OVERRIDE { 172 virtual void SetUpOnMainThread() OVERRIDE {
173 ExtensionManagementApiBrowserTest::SetUpOnMainThread();
174
173 EXPECT_TRUE(scoped_temp_dir_.CreateUniqueTempDir()); 175 EXPECT_TRUE(scoped_temp_dir_.CreateUniqueTempDir());
174 base::FilePath pem_path = test_data_dir_. 176 base::FilePath pem_path = test_data_dir_.
175 AppendASCII("permissions_increase").AppendASCII("permissions.pem"); 177 AppendASCII("permissions_increase").AppendASCII("permissions.pem");
176 base::FilePath path_v1 = PackExtensionWithOptions( 178 base::FilePath path_v1 = PackExtensionWithOptions(
177 test_data_dir_.AppendASCII("permissions_increase").AppendASCII("v1"), 179 test_data_dir_.AppendASCII("permissions_increase").AppendASCII("v1"),
178 scoped_temp_dir_.path().AppendASCII("permissions1.crx"), 180 scoped_temp_dir_.path().AppendASCII("permissions1.crx"),
179 pem_path, 181 pem_path,
180 base::FilePath()); 182 base::FilePath());
181 base::FilePath path_v2 = PackExtensionWithOptions( 183 base::FilePath path_v2 = PackExtensionWithOptions(
182 test_data_dir_.AppendASCII("permissions_increase").AppendASCII("v2"), 184 test_data_dir_.AppendASCII("permissions_increase").AppendASCII("v2"),
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 // extension should be reloaded and enabled. 265 // extension should be reloaded and enabled.
264 ASSERT_TRUE(CrashEnabledExtension(kId)); 266 ASSERT_TRUE(CrashEnabledExtension(kId));
265 SetEnabled(false, true, ""); 267 SetEnabled(false, true, "");
266 SetEnabled(true, true, ""); 268 SetEnabled(true, true, "");
267 const Extension* extension = ExtensionSystem::Get(browser()->profile())-> 269 const Extension* extension = ExtensionSystem::Get(browser()->profile())->
268 extension_service()->GetExtensionById(kId, false); 270 extension_service()->GetExtensionById(kId, false);
269 EXPECT_TRUE(extension); 271 EXPECT_TRUE(extension);
270 } 272 }
271 273
272 } // namespace extensions 274 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698