summaryrefslogtreecommitdiffstats
path: root/device/bluetooth/bluetooth_adapter_mac_unittest.mm
blob: 6ef4c9b3b7e0c0878e12cfd210f2cdb7665e4f67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/memory/ref_counted.h"
#include "base/test/test_simple_task_runner.h"
#include "device/bluetooth/bluetooth_adapter.h"
#include "device/bluetooth/bluetooth_adapter_mac.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace device {

class BluetoothAdapterMacTest : public testing::Test {
 public:
  BluetoothAdapterMacTest()
      : ui_task_runner_(new base::TestSimpleTaskRunner()),
        adapter_(new BluetoothAdapterMac()),
        adapter_mac_(static_cast<BluetoothAdapterMac*>(adapter_.get())) {
    adapter_mac_->InitForTest(ui_task_runner_);
  }

 protected:
  scoped_refptr<base::TestSimpleTaskRunner> ui_task_runner_;
  scoped_refptr<BluetoothAdapter> adapter_;
  BluetoothAdapterMac* adapter_mac_;
};

TEST_F(BluetoothAdapterMacTest, Poll) {
  EXPECT_FALSE(ui_task_runner_->GetPendingTasks().empty());
}

}  // namespace device