| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 bool SimulateExtensionUnload(const std::string& extension_id) { | 318 bool SimulateExtensionUnload(const std::string& extension_id) { |
| 319 ExtensionRegistry* extension_registry = | 319 ExtensionRegistry* extension_registry = |
| 320 ExtensionRegistry::Get(browser_context()); | 320 ExtensionRegistry::Get(browser_context()); |
| 321 | 321 |
| 322 const Extension* extension = extension_registry->GetExtensionById( | 322 const Extension* extension = extension_registry->GetExtensionById( |
| 323 extension_id, ExtensionRegistry::ENABLED); | 323 extension_id, ExtensionRegistry::ENABLED); |
| 324 if (!extension) | 324 if (!extension) |
| 325 return false; | 325 return false; |
| 326 | 326 |
| 327 extension_registry->RemoveEnabled(extension_id); | 327 extension_registry->RemoveEnabled(extension_id); |
| 328 extension_registry->TriggerOnUnloaded( | 328 extension_registry->TriggerOnUnloaded(extension, |
| 329 extension, UnloadedExtensionInfo::REASON_TERMINATE); | 329 UnloadedExtensionReason::TERMINATE); |
| 330 return true; | 330 return true; |
| 331 } | 331 } |
| 332 | 332 |
| 333 // Validates that set of printers reported by test apps via | 333 // Validates that set of printers reported by test apps via |
| 334 // chrome.printerProvider.onGetPritersRequested is the same as the set of | 334 // chrome.printerProvider.onGetPritersRequested is the same as the set of |
| 335 // printers in |expected_printers|. |expected_printers| contains list of | 335 // printers in |expected_printers|. |expected_printers| contains list of |
| 336 // printer objects formatted as a JSON string. It is assumed that the values | 336 // printer objects formatted as a JSON string. It is assumed that the values |
| 337 // in |expoected_printers| are unique. | 337 // in |expoected_printers| are unique. |
| 338 void ValidatePrinterListValue( | 338 void ValidatePrinterListValue( |
| 339 const base::ListValue& printers, | 339 const base::ListValue& printers, |
| (...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 864 RunUsbPrinterInfoRequestTest("EMPTY_RESPONSE"); | 864 RunUsbPrinterInfoRequestTest("EMPTY_RESPONSE"); |
| 865 } | 865 } |
| 866 | 866 |
| 867 IN_PROC_BROWSER_TEST_F(PrinterProviderApiTest, GetUsbPrinterInfoNoListener) { | 867 IN_PROC_BROWSER_TEST_F(PrinterProviderApiTest, GetUsbPrinterInfoNoListener) { |
| 868 RunUsbPrinterInfoRequestTest("NO_LISTENER"); | 868 RunUsbPrinterInfoRequestTest("NO_LISTENER"); |
| 869 } | 869 } |
| 870 | 870 |
| 871 } // namespace | 871 } // namespace |
| 872 | 872 |
| 873 } // namespace extensions | 873 } // namespace extensions |
| OLD | NEW |