| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "chrome/browser/extensions/extension_apitest.h" | 9 #include "chrome/browser/extensions/extension_apitest.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 using extensions::ResultCatcher; | 33 using extensions::ResultCatcher; |
| 34 | 34 |
| 35 namespace api = extensions::core_api; | 35 namespace api = extensions::core_api; |
| 36 | 36 |
| 37 namespace { | 37 namespace { |
| 38 | 38 |
| 39 class BluetoothSocketApiTest : public ExtensionApiTest { | 39 class BluetoothSocketApiTest : public ExtensionApiTest { |
| 40 public: | 40 public: |
| 41 BluetoothSocketApiTest() {} | 41 BluetoothSocketApiTest() {} |
| 42 | 42 |
| 43 virtual void SetUpOnMainThread() OVERRIDE { | 43 virtual void SetUpOnMainThread() override { |
| 44 ExtensionApiTest::SetUpOnMainThread(); | 44 ExtensionApiTest::SetUpOnMainThread(); |
| 45 empty_extension_ = extensions::test_util::CreateEmptyExtension(); | 45 empty_extension_ = extensions::test_util::CreateEmptyExtension(); |
| 46 SetUpMockAdapter(); | 46 SetUpMockAdapter(); |
| 47 } | 47 } |
| 48 | 48 |
| 49 void SetUpMockAdapter() { | 49 void SetUpMockAdapter() { |
| 50 // The browser will clean this up when it is torn down. | 50 // The browser will clean this up when it is torn down. |
| 51 mock_adapter_ = new testing::StrictMock<MockBluetoothAdapter>(); | 51 mock_adapter_ = new testing::StrictMock<MockBluetoothAdapter>(); |
| 52 BluetoothAdapterFactory::SetAdapterForTesting(mock_adapter_); | 52 BluetoothAdapterFactory::SetAdapterForTesting(mock_adapter_); |
| 53 | 53 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 catcher.RestrictToBrowserContext(browser()->profile()); | 211 catcher.RestrictToBrowserContext(browser()->profile()); |
| 212 | 212 |
| 213 // Run the test. | 213 // Run the test. |
| 214 scoped_refptr<const Extension> extension( | 214 scoped_refptr<const Extension> extension( |
| 215 LoadExtension(test_data_dir_.AppendASCII( | 215 LoadExtension(test_data_dir_.AppendASCII( |
| 216 "bluetooth_socket/permission_denied"))); | 216 "bluetooth_socket/permission_denied"))); |
| 217 ASSERT_TRUE(extension.get()); | 217 ASSERT_TRUE(extension.get()); |
| 218 | 218 |
| 219 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 219 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
| 220 } | 220 } |
| OLD | NEW |