OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
7 #include "base/thread_task_runner_handle.h" | 7 #include "base/thread_task_runner_handle.h" |
8 #include "device/hid/hid_collection_info.h" | 8 #include "device/hid/hid_collection_info.h" |
9 #include "device/hid/hid_connection.h" | 9 #include "device/hid/hid_connection.h" |
10 #include "device/hid/hid_device_info.h" | 10 #include "device/hid/hid_device_info.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 } | 197 } |
198 | 198 |
199 IN_PROC_BROWSER_TEST_F(HidApiTest, OnDeviceRemoved) { | 199 IN_PROC_BROWSER_TEST_F(HidApiTest, OnDeviceRemoved) { |
200 ExtensionTestMessageListener load_listener("loaded", false); | 200 ExtensionTestMessageListener load_listener("loaded", false); |
201 ExtensionTestMessageListener result_listener("success", false); | 201 ExtensionTestMessageListener result_listener("success", false); |
202 result_listener.set_failure_message("failure"); | 202 result_listener.set_failure_message("failure"); |
203 | 203 |
204 ASSERT_TRUE(LoadApp("api_test/hid/remove_event")); | 204 ASSERT_TRUE(LoadApp("api_test/hid/remove_event")); |
205 ASSERT_TRUE(load_listener.WaitUntilSatisfied()); | 205 ASSERT_TRUE(load_listener.WaitUntilSatisfied()); |
206 | 206 |
207 // Device C was not returned by chrome.usb.getDevices, the app will not get | 207 // Device C was not returned by chrome.hid.getDevices, the app will not get |
208 // a notification. | 208 // a notification. |
209 hid_service_->RemoveDevice("C"); | 209 hid_service_->RemoveDevice("C"); |
210 // Device A was returned, the app will get a notification. | 210 // Device A was returned, the app will get a notification. |
211 hid_service_->RemoveDevice("A"); | 211 hid_service_->RemoveDevice("A"); |
212 ASSERT_TRUE(result_listener.WaitUntilSatisfied()); | 212 ASSERT_TRUE(result_listener.WaitUntilSatisfied()); |
213 EXPECT_EQ("success", result_listener.message()); | 213 EXPECT_EQ("success", result_listener.message()); |
214 } | 214 } |
215 | 215 |
216 } // namespace extensions | 216 } // namespace extensions |
OLD | NEW |