| OLD | NEW |
| 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 <queue> | 5 #include <queue> |
| 6 #include <string> | 6 #include <string> |
| 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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 scoped_ptr<base::ListValue> original_printers( | 546 scoped_ptr<base::ListValue> original_printers( |
| 547 GetJSONAsListValue(kPrinterDescriptionList, &error)); | 547 GetJSONAsListValue(kPrinterDescriptionList, &error)); |
| 548 ASSERT_TRUE(original_printers) << "Error deserializing printers: " << error; | 548 ASSERT_TRUE(original_printers) << "Error deserializing printers: " << error; |
| 549 | 549 |
| 550 fake_api->TriggerNextGetPrintersCallback(*original_printers, true); | 550 fake_api->TriggerNextGetPrintersCallback(*original_printers, true); |
| 551 | 551 |
| 552 EXPECT_EQ(0u, call_count); | 552 EXPECT_EQ(0u, call_count); |
| 553 } | 553 } |
| 554 | 554 |
| 555 TEST_F(ExtensionPrinterHandlerTest, GetUsbPrinters) { | 555 TEST_F(ExtensionPrinterHandlerTest, GetUsbPrinters) { |
| 556 extensions::ScopedCurrentChannel channel(chrome::VersionInfo::CHANNEL_DEV); | 556 extensions::ScopedCurrentChannel channel(version_info::Channel::DEV); |
| 557 | 557 |
| 558 scoped_refptr<MockUsbDevice> device0 = | 558 scoped_refptr<MockUsbDevice> device0 = |
| 559 new MockUsbDevice(0, 0, "Google", "USB Printer", ""); | 559 new MockUsbDevice(0, 0, "Google", "USB Printer", ""); |
| 560 usb_service_.AddDevice(device0); | 560 usb_service_.AddDevice(device0); |
| 561 scoped_refptr<MockUsbDevice> device1 = | 561 scoped_refptr<MockUsbDevice> device1 = |
| 562 new MockUsbDevice(0, 1, "Google", "USB Printer", ""); | 562 new MockUsbDevice(0, 1, "Google", "USB Printer", ""); |
| 563 usb_service_.AddDevice(device1); | 563 usb_service_.AddDevice(device1); |
| 564 | 564 |
| 565 const Extension* extension_1 = env_.MakeExtension( | 565 const Extension* extension_1 = env_.MakeExtension( |
| 566 *base::test::ParseJson(kExtension1), "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); | 566 *base::test::ParseJson(kExtension1), "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1018 DictionaryBuilder() | 1018 DictionaryBuilder() |
| 1019 .Set("id", "printer1") | 1019 .Set("id", "printer1") |
| 1020 .Set("name", "Printer 1") | 1020 .Set("name", "Printer 1") |
| 1021 .Build()); | 1021 .Build()); |
| 1022 | 1022 |
| 1023 fake_api->TriggerNextUsbPrinterInfoCallback(*original_printer_info); | 1023 fake_api->TriggerNextUsbPrinterInfoCallback(*original_printer_info); |
| 1024 | 1024 |
| 1025 EXPECT_EQ(0u, call_count); | 1025 EXPECT_EQ(0u, call_count); |
| 1026 EXPECT_FALSE(printer_info.get()); | 1026 EXPECT_FALSE(printer_info.get()); |
| 1027 } | 1027 } |
| OLD | NEW |