OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "chrome/browser/chromeos/printing/printers_manager.h" | 5 #include "chrome/browser/chromeos/printing/printers_manager.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 auto printers = manager_->GetRecommendedPrinters(); | 218 auto printers = manager_->GetRecommendedPrinters(); |
219 | 219 |
220 const Printer& from_list = *(printers.front()); | 220 const Printer& from_list = *(printers.front()); |
221 std::unique_ptr<Printer> retrieved = manager_->GetPrinter(from_list.id()); | 221 std::unique_ptr<Printer> retrieved = manager_->GetPrinter(from_list.id()); |
222 | 222 |
223 EXPECT_EQ(from_list.id(), retrieved->id()); | 223 EXPECT_EQ(from_list.id(), retrieved->id()); |
224 EXPECT_EQ("LexaPrint", from_list.display_name()); | 224 EXPECT_EQ("LexaPrint", from_list.display_name()); |
225 EXPECT_EQ(Printer::Source::SRC_POLICY, from_list.source()); | 225 EXPECT_EQ(Printer::Source::SRC_POLICY, from_list.source()); |
226 } | 226 } |
227 | 227 |
| 228 TEST_F(PrintersManagerTest, PrinterNotInstalled) { |
| 229 Printer printer(kPrinterId, 1000); |
| 230 EXPECT_FALSE(manager_->IsConfigurationCurrent(printer)); |
| 231 } |
| 232 |
| 233 TEST_F(PrintersManagerTest, PrinterIsInstalled) { |
| 234 Printer printer(kPrinterId, 1000); |
| 235 manager_->PrinterInstalled(printer); |
| 236 EXPECT_TRUE(manager_->IsConfigurationCurrent(printer)); |
| 237 } |
| 238 |
| 239 TEST_F(PrintersManagerTest, UpdatedPrinterConfiguration) { |
| 240 Printer printer(kPrinterId, 1000); |
| 241 manager_->PrinterInstalled(printer); |
| 242 |
| 243 Printer updated_printer(kPrinterId, 2000); |
| 244 EXPECT_FALSE(manager_->IsConfigurationCurrent(updated_printer)); |
| 245 } |
| 246 |
228 } // namespace chromeos | 247 } // namespace chromeos |
OLD | NEW |