• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2013 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 "base/memory/ref_counted.h"
6#include "base/test/test_simple_task_runner.h"
7#include "device/bluetooth/bluetooth_adapter.h"
8#include "device/bluetooth/bluetooth_adapter_mac.h"
9#include "testing/gtest/include/gtest/gtest.h"
10
11namespace device {
12
13class BluetoothAdapterMacTest : public testing::Test {
14 public:
15  BluetoothAdapterMacTest()
16      : ui_task_runner_(new base::TestSimpleTaskRunner()),
17        adapter_(new BluetoothAdapterMac()),
18        adapter_mac_(static_cast<BluetoothAdapterMac*>(adapter_.get())) {
19    adapter_mac_->InitForTest(ui_task_runner_);
20  }
21
22 protected:
23  scoped_refptr<base::TestSimpleTaskRunner> ui_task_runner_;
24  scoped_refptr<BluetoothAdapter> adapter_;
25  BluetoothAdapterMac* adapter_mac_;
26};
27
28TEST_F(BluetoothAdapterMacTest, Poll) {
29  EXPECT_FALSE(ui_task_runner_->GetPendingTasks().empty());
30}
31
32}  // namespace device
33