OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "chrome/browser/chromeos/printing/specifics_translation.h" | 10 #include "chrome/browser/chromeos/printing/specifics_translation.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 constexpr char kUri[] = "ipps://notaprinter.chromium.org/ipp/print"; | 23 constexpr char kUri[] = "ipps://notaprinter.chromium.org/ipp/print"; |
24 constexpr char kUuid[] = "UUIDUUIDUUID"; | 24 constexpr char kUuid[] = "UUIDUUIDUUID"; |
25 const base::Time kUpdateTime = base::Time::FromInternalValue(22114455660000); | 25 const base::Time kUpdateTime = base::Time::FromInternalValue(22114455660000); |
26 | 26 |
27 constexpr char kUserSuppliedPPD[] = "file://foo/bar/baz/eeaaaffccdd00"; | 27 constexpr char kUserSuppliedPPD[] = "file://foo/bar/baz/eeaaaffccdd00"; |
28 constexpr char kEffectiveMakeAndModel[] = "Manufacturer Model T1000"; | 28 constexpr char kEffectiveMakeAndModel[] = "Manufacturer Model T1000"; |
29 | 29 |
30 } // namespace | 30 } // namespace |
31 | 31 |
32 namespace chromeos { | 32 namespace chromeos { |
33 namespace printing { | |
34 | 33 |
35 TEST(SpecificsTranslationTest, SpecificsToPrinter) { | 34 TEST(SpecificsTranslationTest, SpecificsToPrinter) { |
36 sync_pb::PrinterSpecifics specifics; | 35 sync_pb::PrinterSpecifics specifics; |
37 specifics.set_id(kId); | 36 specifics.set_id(kId); |
38 specifics.set_display_name(kDisplayName); | 37 specifics.set_display_name(kDisplayName); |
39 specifics.set_description(kDescription); | 38 specifics.set_description(kDescription); |
40 specifics.set_make_and_model(kMakeAndModel); | 39 specifics.set_make_and_model(kMakeAndModel); |
41 specifics.set_uri(kUri); | 40 specifics.set_uri(kUri); |
42 specifics.set_uuid(kUuid); | 41 specifics.set_uuid(kUuid); |
43 specifics.set_updated_timestamp(kUpdateTime.ToJavaTime()); | 42 specifics.set_updated_timestamp(kUpdateTime.ToJavaTime()); |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 original.set_id(kId); | 215 original.set_id(kId); |
217 original.set_manufacturer(make); | 216 original.set_manufacturer(make); |
218 original.set_model(model); | 217 original.set_model(model); |
219 original.set_make_and_model(kMakeAndModel); | 218 original.set_make_and_model(kMakeAndModel); |
220 | 219 |
221 auto printer = SpecificsToPrinter(original); | 220 auto printer = SpecificsToPrinter(original); |
222 | 221 |
223 EXPECT_EQ(kMakeAndModel, printer->make_and_model()); | 222 EXPECT_EQ(kMakeAndModel, printer->make_and_model()); |
224 } | 223 } |
225 | 224 |
226 } // namespace printing | |
227 } // namespace chromeos | 225 } // namespace chromeos |
OLD | NEW |