Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(408)

Side by Side Diff: device/devices_app/devices_apptest.cc

Issue 1682363002: Remove //device/devices_app. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove two files that somehow survived in //device/devices_app. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « device/devices_app/devices_app.gyp ('k') | device/devices_app/main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include <utility>
6
7 #include "base/bind.h"
8 #include "base/callback.h"
9 #include "base/macros.h"
10 #include "base/run_loop.h"
11 #include "device/devices_app/devices_app.h"
12 #include "device/devices_app/usb/public/interfaces/device_manager.mojom.h"
13 #include "mojo/shell/public/cpp/application_test_base.h"
14
15 namespace device {
16 namespace {
17
18 class DevicesAppTest : public mojo::test::ApplicationTestBase {
19 public:
20 DevicesAppTest() {}
21 ~DevicesAppTest() override {}
22
23 void SetUp() override {
24 ApplicationTestBase::SetUp();
25 shell()->ConnectToInterface("mojo:devices", &usb_device_manager_);
26 }
27
28 usb::DeviceManager* usb_device_manager() { return usb_device_manager_.get(); }
29
30 private:
31 usb::DeviceManagerPtr usb_device_manager_;
32
33 DISALLOW_COPY_AND_ASSIGN(DevicesAppTest);
34 };
35
36 void OnGetDevices(const base::Closure& continuation,
37 mojo::Array<usb::DeviceInfoPtr> devices) {
38 continuation.Run();
39 }
40
41 } // namespace
42
43 // Simple test to verify that we can connect to the USB DeviceManager and get
44 // a response.
45 TEST_F(DevicesAppTest, GetUSBDevices) {
46 base::RunLoop loop;
47 usb::EnumerationOptionsPtr options = usb::EnumerationOptions::New();
48 options->filters = mojo::Array<usb::DeviceFilterPtr>(1);
49 options->filters[0] = usb::DeviceFilter::New();
50 usb_device_manager()->GetDevices(
51 std::move(options), base::Bind(&OnGetDevices, loop.QuitClosure()));
52 loop.Run();
53 }
54
55 } // namespace device
OLDNEW
« no previous file with comments | « device/devices_app/devices_app.gyp ('k') | device/devices_app/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698