OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string.h> | 5 #include <string.h> |
6 | 6 |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/extensions/extension_apitest.h" | 9 #include "chrome/browser/extensions/extension_apitest.h" |
10 #include "chrome/browser/extensions/extension_function_test_utils.h" | 10 #include "chrome/browser/extensions/extension_function_test_utils.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 namespace { | 39 namespace { |
40 | 40 |
41 static const char* kAdapterAddress = "A1:A2:A3:A4:A5:A6"; | 41 static const char* kAdapterAddress = "A1:A2:A3:A4:A5:A6"; |
42 static const char* kName = "whatsinaname"; | 42 static const char* kName = "whatsinaname"; |
43 | 43 |
44 class BluetoothApiTest : public ExtensionApiTest { | 44 class BluetoothApiTest : public ExtensionApiTest { |
45 public: | 45 public: |
46 BluetoothApiTest() {} | 46 BluetoothApiTest() {} |
47 | 47 |
48 virtual void SetUpOnMainThread() OVERRIDE { | 48 virtual void SetUpOnMainThread() override { |
49 ExtensionApiTest::SetUpOnMainThread(); | 49 ExtensionApiTest::SetUpOnMainThread(); |
50 empty_extension_ = extensions::test_util::CreateEmptyExtension(); | 50 empty_extension_ = extensions::test_util::CreateEmptyExtension(); |
51 SetUpMockAdapter(); | 51 SetUpMockAdapter(); |
52 } | 52 } |
53 | 53 |
54 virtual void TearDownOnMainThread() OVERRIDE { | 54 virtual void TearDownOnMainThread() override { |
55 EXPECT_CALL(*mock_adapter_, RemoveObserver(testing::_)); | 55 EXPECT_CALL(*mock_adapter_, RemoveObserver(testing::_)); |
56 } | 56 } |
57 | 57 |
58 void SetUpMockAdapter() { | 58 void SetUpMockAdapter() { |
59 // The browser will clean this up when it is torn down | 59 // The browser will clean this up when it is torn down |
60 mock_adapter_ = new testing::StrictMock<MockBluetoothAdapter>(); | 60 mock_adapter_ = new testing::StrictMock<MockBluetoothAdapter>(); |
61 event_router()->SetAdapterForTest(mock_adapter_); | 61 event_router()->SetAdapterForTest(mock_adapter_); |
62 | 62 |
63 device1_.reset(new testing::NiceMock<MockBluetoothDevice>( | 63 device1_.reset(new testing::NiceMock<MockBluetoothDevice>( |
64 mock_adapter_, 0, "d1", "11:12:13:14:15:16", | 64 mock_adapter_, 0, "d1", "11:12:13:14:15:16", |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 // Load and wait for setup | 453 // Load and wait for setup |
454 ExtensionTestMessageListener listener("ready", true); | 454 ExtensionTestMessageListener listener("ready", true); |
455 ASSERT_TRUE( | 455 ASSERT_TRUE( |
456 LoadExtension(test_data_dir_.AppendASCII("bluetooth/device_info"))); | 456 LoadExtension(test_data_dir_.AppendASCII("bluetooth/device_info"))); |
457 EXPECT_TRUE(listener.WaitUntilSatisfied()); | 457 EXPECT_TRUE(listener.WaitUntilSatisfied()); |
458 | 458 |
459 listener.Reply("go"); | 459 listener.Reply("go"); |
460 | 460 |
461 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 461 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
462 } | 462 } |
OLD | NEW |