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

Side by Side Diff: extensions/browser/api/printer_provider/printer_provider_apitest.cc

Issue 2839373003: struct UnloadedExtensionInfo -> enum UnloadedExtensionInfoReason (Closed)
Patch Set: Rebase Created 3 years, 7 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 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
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
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
OLDNEW
« no previous file with comments | « extensions/browser/api/printer_provider/printer_provider_api.cc ('k') | extensions/browser/api/vpn_provider/vpn_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698