OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "extensions/browser/api/bluetooth/bluetooth_event_router.h" | 5 #include "extensions/browser/api/bluetooth/bluetooth_event_router.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 scoped_refptr<const Extension> extension = | 87 scoped_refptr<const Extension> extension = |
88 ExtensionBuilder() | 88 ExtensionBuilder() |
89 .SetManifest(DictionaryBuilder() | 89 .SetManifest(DictionaryBuilder() |
90 .Set("name", "BT event router test") | 90 .Set("name", "BT event router test") |
91 .Set("version", "1.0") | 91 .Set("version", "1.0") |
92 .Set("manifest_version", 2) | 92 .Set("manifest_version", 2) |
93 .Build()) | 93 .Build()) |
94 .SetID(kTestExtensionId) | 94 .SetID(kTestExtensionId) |
95 .Build(); | 95 .Build(); |
96 | 96 |
97 ExtensionRegistry::Get(browser_context())->TriggerOnUnloaded( | 97 ExtensionRegistry::Get(browser_context()) |
98 extension.get(), UnloadedExtensionInfo::REASON_DISABLE); | 98 ->TriggerOnUnloaded(extension.get(), UnloadedExtensionReason::DISABLE); |
99 | 99 |
100 EXPECT_CALL(*mock_adapter_, RemoveObserver(testing::_)).Times(1); | 100 EXPECT_CALL(*mock_adapter_, RemoveObserver(testing::_)).Times(1); |
101 } | 101 } |
102 | 102 |
103 // This test check that calling SetDiscoveryFilter before StartDiscoverySession | 103 // This test check that calling SetDiscoveryFilter before StartDiscoverySession |
104 // for given extension will start session with proper filter. | 104 // for given extension will start session with proper filter. |
105 TEST_F(BluetoothEventRouterTest, SetDiscoveryFilter) { | 105 TEST_F(BluetoothEventRouterTest, SetDiscoveryFilter) { |
106 std::unique_ptr<device::BluetoothDiscoveryFilter> discovery_filter( | 106 std::unique_ptr<device::BluetoothDiscoveryFilter> discovery_filter( |
107 new device::BluetoothDiscoveryFilter(device::BLUETOOTH_TRANSPORT_LE)); | 107 new device::BluetoothDiscoveryFilter(device::BLUETOOTH_TRANSPORT_LE)); |
108 | 108 |
(...skipping 12 matching lines...) Expand all Loading... |
121 testing::_, testing::_)).Times(1); | 121 testing::_, testing::_)).Times(1); |
122 | 122 |
123 router_->StartDiscoverySession(mock_adapter_, kTestExtensionId, | 123 router_->StartDiscoverySession(mock_adapter_, kTestExtensionId, |
124 base::Bind(&base::DoNothing), | 124 base::Bind(&base::DoNothing), |
125 base::Bind(&base::DoNothing)); | 125 base::Bind(&base::DoNothing)); |
126 | 126 |
127 EXPECT_CALL(*mock_adapter_, RemoveObserver(testing::_)).Times(1); | 127 EXPECT_CALL(*mock_adapter_, RemoveObserver(testing::_)).Times(1); |
128 } | 128 } |
129 | 129 |
130 } // namespace extensions | 130 } // namespace extensions |
OLD | NEW |