• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2019 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include "l2cap/classic/internal/signalling_manager.h"
18 
19 #include "l2cap/classic/internal/dynamic_channel_service_manager_impl_mock.h"
20 #include "l2cap/classic/internal/fixed_channel_service_manager_impl_mock.h"
21 #include "l2cap/classic/internal/link_mock.h"
22 #include "l2cap/internal/parameter_provider_mock.h"
23 
24 #include <gmock/gmock.h>
25 #include <gtest/gtest.h>
26 
27 using ::testing::_;
28 using ::testing::Return;
29 
30 namespace bluetooth {
31 namespace l2cap {
32 namespace classic {
33 namespace internal {
34 namespace {
35 
36 class L2capClassicSignallingManagerTest : public ::testing::Test {
37  public:
SyncHandler(os::Handler * handler)38   static void SyncHandler(os::Handler* handler) {
39     std::promise<void> promise;
40     auto future = promise.get_future();
41     handler->Post(common::BindOnce(&std::promise<void>::set_value, common::Unretained(&promise)));
42     future.wait_for(std::chrono::milliseconds(3));
43   }
44 
45  protected:
SetUp()46   void SetUp() override {
47     thread_ = new os::Thread("test_thread", os::Thread::Priority::NORMAL);
48     l2cap_handler_ = new os::Handler(thread_);
49   }
50 
TearDown()51   void TearDown() override {
52     l2cap_handler_->Clear();
53     delete l2cap_handler_;
54     delete thread_;
55   }
56 
57   os::Thread* thread_ = nullptr;
58   os::Handler* l2cap_handler_ = nullptr;
59 };
60 
TEST_F(L2capClassicSignallingManagerTest,precondition)61 TEST_F(L2capClassicSignallingManagerTest, precondition) {}
62 
63 }  // namespace
64 }  // namespace internal
65 }  // namespace classic
66 }  // namespace l2cap
67 }  // namespace bluetooth
68