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

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

Issue 1148383002: Add onGetUsbPrinterInfoRequested event to printerProvider API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. 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
« no previous file with comments | « no previous file | extensions/browser/api/printer_provider/printer_provider_api.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 void DispatchPrintRequested( 348 void DispatchPrintRequested(
349 const PrinterProviderPrintJob& job, 349 const PrinterProviderPrintJob& job,
350 const PrinterProviderAPI::PrintCallback& callback) override { 350 const PrinterProviderAPI::PrintCallback& callback) override {
351 PrintRequestInfo request_info; 351 PrintRequestInfo request_info;
352 request_info.callback = callback; 352 request_info.callback = callback;
353 request_info.job = job; 353 request_info.job = job;
354 354
355 pending_print_requests_.push_back(request_info); 355 pending_print_requests_.push_back(request_info);
356 } 356 }
357 357
358 void DispatchGetUsbPrinterInfoRequested(
359 const std::string& extension_id,
360 scoped_refptr<device::UsbDevice> device,
361 const PrinterProviderAPI::GetPrinterInfoCallback& callback) override {
362 ADD_FAILURE() << "Not reached.";
363 }
364
358 size_t pending_get_printers_count() const { 365 size_t pending_get_printers_count() const {
359 return pending_printers_callbacks_.size(); 366 return pending_printers_callbacks_.size();
360 } 367 }
361 368
362 const PrinterProviderPrintJob* GetPrintJob( 369 const PrinterProviderPrintJob* GetPrintJob(
363 const extensions::Extension* extension, 370 const extensions::Extension* extension,
364 int request_id) const override { 371 int request_id) const override {
365 ADD_FAILURE() << "Not reached"; 372 ADD_FAILURE() << "Not reached";
366 return nullptr; 373 return nullptr;
367 } 374 }
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 extension_printer_handler_->StartPrint( 929 extension_printer_handler_->StartPrint(
923 kPrinterId, kPWGRasterOnlyPrinterSimpleDescription, title, 930 kPrinterId, kPWGRasterOnlyPrinterSimpleDescription, title,
924 kEmptyPrintTicket, gfx::Size(100, 100), print_data, 931 kEmptyPrintTicket, gfx::Size(100, 100), print_data,
925 base::Bind(&RecordPrintResult, &call_count, &success, &status)); 932 base::Bind(&RecordPrintResult, &call_count, &success, &status));
926 933
927 EXPECT_EQ(1u, call_count); 934 EXPECT_EQ(1u, call_count);
928 935
929 EXPECT_FALSE(success); 936 EXPECT_FALSE(success);
930 EXPECT_EQ("INVALID_DATA", status); 937 EXPECT_EQ("INVALID_DATA", status);
931 } 938 }
OLDNEW
« no previous file with comments | « no previous file | extensions/browser/api/printer_provider/printer_provider_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698