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

Side by Side Diff: chrome/browser/ui/webui/print_preview/extension_printer_handler_unittest.cc

Issue 1165913002: [Cleanup] Used scoped pointers in KeyedServiceFactory's SetTestingFactory functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Finish renaming profile -> context Created 5 years, 6 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 <queue> 5 #include <queue>
6 #include <string> 6 #include <string>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 pending_printers_callbacks_; 434 pending_printers_callbacks_;
435 std::queue<PrinterProviderAPI::GetCapabilityCallback> 435 std::queue<PrinterProviderAPI::GetCapabilityCallback>
436 pending_capability_callbacks_; 436 pending_capability_callbacks_;
437 std::queue<PrintRequestInfo> pending_print_requests_; 437 std::queue<PrintRequestInfo> pending_print_requests_;
438 std::queue<PrinterProviderAPI::GetPrinterInfoCallback> 438 std::queue<PrinterProviderAPI::GetPrinterInfoCallback>
439 pending_usb_info_callbacks_; 439 pending_usb_info_callbacks_;
440 440
441 DISALLOW_COPY_AND_ASSIGN(FakePrinterProviderAPI); 441 DISALLOW_COPY_AND_ASSIGN(FakePrinterProviderAPI);
442 }; 442 };
443 443
444 KeyedService* BuildTestingPrinterProviderAPI(content::BrowserContext* context) { 444 scoped_ptr<KeyedService> BuildTestingPrinterProviderAPI(
445 return new FakePrinterProviderAPI(); 445 content::BrowserContext* context) {
446 return make_scoped_ptr(new FakePrinterProviderAPI());
446 } 447 }
447 448
448 class FakeDeviceClient : public device::DeviceClient { 449 class FakeDeviceClient : public device::DeviceClient {
449 public: 450 public:
450 FakeDeviceClient() {} 451 FakeDeviceClient() {}
451 452
452 // device::DeviceClient implementation: 453 // device::DeviceClient implementation:
453 device::UsbService* GetUsbService() override { 454 device::UsbService* GetUsbService() override {
454 DCHECK(usb_service_); 455 DCHECK(usb_service_);
455 return usb_service_; 456 return usb_service_;
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
1017 DictionaryBuilder() 1018 DictionaryBuilder()
1018 .Set("id", "printer1") 1019 .Set("id", "printer1")
1019 .Set("name", "Printer 1") 1020 .Set("name", "Printer 1")
1020 .Build()); 1021 .Build());
1021 1022
1022 fake_api->TriggerNextUsbPrinterInfoCallback(*original_printer_info); 1023 fake_api->TriggerNextUsbPrinterInfoCallback(*original_printer_info);
1023 1024
1024 EXPECT_EQ(0u, call_count); 1025 EXPECT_EQ(0u, call_count);
1025 EXPECT_FALSE(printer_info.get()); 1026 EXPECT_FALSE(printer_info.get());
1026 } 1027 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/test_with_browser_view.cc ('k') | chrome/test/base/chrome_render_view_host_test_harness.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698