diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2024-01-26 13:38:42 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2024-02-22 12:48:48 +0000 |
commit | ada9ddbf8c604585ac344b72f7bb63ac27c84726 (patch) | |
tree | b541471f60775e79ce2a664f01f2cff4765dc6b2 /chromium/chrome/browser/ui/webui/print_preview/local_printer_handler_chromeos_unittest.cc | |
parent | bccd0c89f058482e730b73829d80bb6e8defa4c9 (diff) |
BASELINE: Update Chromium to 120.0.6099.272
Change-Id: Id1e3f32155016fcdca5b92e1739d85c6093bcf84
Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/534618
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/chrome/browser/ui/webui/print_preview/local_printer_handler_chromeos_unittest.cc')
-rw-r--r-- | chromium/chrome/browser/ui/webui/print_preview/local_printer_handler_chromeos_unittest.cc | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/chromium/chrome/browser/ui/webui/print_preview/local_printer_handler_chromeos_unittest.cc b/chromium/chrome/browser/ui/webui/print_preview/local_printer_handler_chromeos_unittest.cc index b7a830f6318..97424e739f4 100644 --- a/chromium/chrome/browser/ui/webui/print_preview/local_printer_handler_chromeos_unittest.cc +++ b/chromium/chrome/browser/ui/webui/print_preview/local_printer_handler_chromeos_unittest.cc @@ -40,6 +40,8 @@ using ::testing::NiceMock; using ::testing::Return; using ::testing::WithArg; +constexpr auto kStatusTimestamp = base::Time::FromSecondsSinceUnixEpoch(1e9); + // A `LocalPrinter` implementation where all functions run callbacks with // reasonable default values. class TestLocalPrinter : public FakeLocalPrinter { @@ -362,13 +364,29 @@ TEST_F(LocalPrinterHandlerChromeosWithAshTest, GetAshJobSettingsClientInfo) { } TEST(LocalPrinterHandlerChromeos, PrinterToValue) { + crosapi::mojom::PrinterStatusPtr status = + crosapi::mojom::PrinterStatus::New(); + status->printer_id = "printer_id"; + status->timestamp = kStatusTimestamp; + status->status_reasons.push_back(crosapi::mojom::StatusReason::New( + crosapi::mojom::StatusReason::Reason::kOutOfInk, + crosapi::mojom::StatusReason::Severity::kWarning)); crosapi::mojom::LocalDestinationInfo input("device_name", "printer_name", - "printer_description", false); + "printer_description", false, "", + std::move(status)); const base::Value kExpectedValue = base::test::ParseJson(R"({ "cupsEnterprisePrinter": false, "deviceName": "device_name", "printerDescription": "printer_description", - "printerName": "printer_name" + "printerName": "printer_name", + "printerStatus": { + "printerId": "printer_id", + "statusReasons": [ { + "reason": 6, + "severity": 2 + } ], + "timestamp": 1e+12 + } })"); EXPECT_EQ(kExpectedValue, LocalPrinterHandlerChromeos::PrinterToValue(input)); } @@ -380,7 +398,8 @@ TEST(LocalPrinterHandlerChromeos, PrinterToValue_ConfiguredViaPolicy) { "cupsEnterprisePrinter": true, "deviceName": "device_name", "printerDescription": "printer_description", - "printerName": "printer_name" + "printerName": "printer_name", + "printerStatus": {} })"); EXPECT_EQ(kExpectedValue, LocalPrinterHandlerChromeos::PrinterToValue(printer)); @@ -431,7 +450,7 @@ TEST(LocalPrinterHandlerChromeos, CapabilityToValue_EmptyInput) { TEST(LocalPrinterHandlerChromeos, StatusToValue) { crosapi::mojom::PrinterStatus status; status.printer_id = "printer_id"; - status.timestamp = base::Time::FromDoubleT(1e9); + status.timestamp = kStatusTimestamp; status.status_reasons.push_back(crosapi::mojom::StatusReason::New( crosapi::mojom::StatusReason::Reason::kOutOfInk, crosapi::mojom::StatusReason::Severity::kWarning)); |