| 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/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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 SetEnabled(true, false, keys::kGestureNeededForEscalationError); | 250 SetEnabled(true, false, keys::kGestureNeededForEscalationError); |
| 251 | 251 |
| 252 // Expect an error that user cancelled the dialog. | 252 // Expect an error that user cancelled the dialog. |
| 253 CommandLine::ForCurrentProcess()->AppendSwitchASCII( | 253 CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
| 254 switches::kAppsGalleryInstallAutoConfirmForTests, "cancel"); | 254 switches::kAppsGalleryInstallAutoConfirmForTests, "cancel"); |
| 255 SetEnabled(true, true, keys::kUserDidNotReEnableError); | 255 SetEnabled(true, true, keys::kUserDidNotReEnableError); |
| 256 | 256 |
| 257 // This should succeed when user accepts dialog. | 257 // This should succeed when user accepts dialog. |
| 258 CommandLine::ForCurrentProcess()->AppendSwitchASCII( | 258 CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
| 259 switches::kAppsGalleryInstallAutoConfirmForTests, "accept"); | 259 switches::kAppsGalleryInstallAutoConfirmForTests, "accept"); |
| 260 SetEnabled(true, true, ""); | 260 SetEnabled(true, true, std::string()); |
| 261 | 261 |
| 262 // Crash the extension. Mock a reload by disabling and then enabling. The | 262 // Crash the extension. Mock a reload by disabling and then enabling. The |
| 263 // extension should be reloaded and enabled. | 263 // extension should be reloaded and enabled. |
| 264 ASSERT_TRUE(CrashEnabledExtension(kId)); | 264 ASSERT_TRUE(CrashEnabledExtension(kId)); |
| 265 SetEnabled(false, true, ""); | 265 SetEnabled(false, true, std::string()); |
| 266 SetEnabled(true, true, ""); | 266 SetEnabled(true, true, std::string()); |
| 267 const Extension* extension = ExtensionSystem::Get(browser()->profile())-> | 267 const Extension* extension = ExtensionSystem::Get(browser()->profile()) |
| 268 extension_service()->GetExtensionById(kId, false); | 268 ->extension_service()->GetExtensionById(kId, false); |
| 269 EXPECT_TRUE(extension); | 269 EXPECT_TRUE(extension); |
| 270 } | 270 } |
| 271 | 271 |
| 272 } // namespace extensions | 272 } // namespace extensions |
| OLD | NEW |