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

Unified Diff: chrome/browser/ui/webui/print_preview/extension_printer_handler_unittest.cc

Issue 2931843003: Print Preview: Change getPrinterCapabilities to cr.sendWithPromise (Closed)
Patch Set: Address comments Created 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/print_preview/extension_printer_handler_unittest.cc
diff --git a/chrome/browser/ui/webui/print_preview/extension_printer_handler_unittest.cc b/chrome/browser/ui/webui/print_preview/extension_printer_handler_unittest.cc
index 668f8d6d60e3712515621e509cbd2ee4c758ae10..94d1ab74df5151d2725cd3d26043acb5c2b44443 100644
--- a/chrome/browser/ui/webui/print_preview/extension_printer_handler_unittest.cc
+++ b/chrome/browser/ui/webui/print_preview/extension_printer_handler_unittest.cc
@@ -203,12 +203,9 @@ void RecordPrinterList(size_t* call_count,
// Used as a callback to StartGetCapability in tests.
// Increases |*call_count| and records values returned by StartGetCapability.
void RecordCapability(size_t* call_count,
- std::string* destination_id_out,
std::unique_ptr<base::DictionaryValue>* capability_out,
- const std::string& destination_id,
const base::DictionaryValue& capability) {
++(*call_count);
- *destination_id_out = destination_id;
capability_out->reset(capability.DeepCopy());
}
@@ -609,12 +606,10 @@ TEST_F(ExtensionPrinterHandlerTest, GetUsbPrinters) {
TEST_F(ExtensionPrinterHandlerTest, GetCapability) {
size_t call_count = 0;
- std::string destination_id;
std::unique_ptr<base::DictionaryValue> capability;
extension_printer_handler_->StartGetCapability(
- kPrinterId,
- base::Bind(&RecordCapability, &call_count, &destination_id, &capability));
+ kPrinterId, base::Bind(&RecordCapability, &call_count, &capability));
EXPECT_EQ(0u, call_count);
@@ -631,7 +626,6 @@ TEST_F(ExtensionPrinterHandlerTest, GetCapability) {
fake_api->TriggerNextGetCapabilityCallback(*original_capability);
EXPECT_EQ(1u, call_count);
- EXPECT_EQ(kPrinterId, destination_id);
ASSERT_TRUE(capability.get());
EXPECT_TRUE(capability->Equals(original_capability.get()))
<< *capability << ", expected: " << *original_capability;
@@ -639,12 +633,10 @@ TEST_F(ExtensionPrinterHandlerTest, GetCapability) {
TEST_F(ExtensionPrinterHandlerTest, GetCapability_Reset) {
size_t call_count = 0;
- std::string destination_id;
std::unique_ptr<base::DictionaryValue> capability;
extension_printer_handler_->StartGetCapability(
- kPrinterId,
- base::Bind(&RecordCapability, &call_count, &destination_id, &capability));
+ kPrinterId, base::Bind(&RecordCapability, &call_count, &capability));
EXPECT_EQ(0u, call_count);

Powered by Google App Engine
This is Rietveld 408576698