| 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/api/bluetooth_socket/bluetooth_socket_api.h" | 9 #include "chrome/browser/extensions/api/bluetooth_socket/bluetooth_socket_api.h" |
| 10 #include "chrome/browser/extensions/extension_apitest.h" | 10 #include "chrome/browser/extensions/extension_apitest.h" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 EXPECT_CALL(*mock_server_socket, Close()); | 183 EXPECT_CALL(*mock_server_socket, Close()); |
| 184 | 184 |
| 185 EXPECT_CALL(*mock_client_socket, Disconnect(testing::_)) | 185 EXPECT_CALL(*mock_client_socket, Disconnect(testing::_)) |
| 186 .WillOnce(InvokeCallbackArgument<0>()); | 186 .WillOnce(InvokeCallbackArgument<0>()); |
| 187 EXPECT_CALL(*mock_client_socket, Close()); | 187 EXPECT_CALL(*mock_client_socket, Close()); |
| 188 | 188 |
| 189 EXPECT_TRUE(listener.WaitUntilSatisfied()); | 189 EXPECT_TRUE(listener.WaitUntilSatisfied()); |
| 190 listener.Reply("go"); | 190 listener.Reply("go"); |
| 191 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 191 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
| 192 } | 192 } |
| 193 |
| 194 IN_PROC_BROWSER_TEST_F(BluetoothSocketApiTest, PermissionDenied) { |
| 195 ResultCatcher catcher; |
| 196 catcher.RestrictToProfile(browser()->profile()); |
| 197 |
| 198 // Run the test. |
| 199 scoped_refptr<const Extension> extension( |
| 200 LoadExtension(test_data_dir_.AppendASCII( |
| 201 "bluetooth_socket/permission_denied"))); |
| 202 ASSERT_TRUE(extension.get()); |
| 203 |
| 204 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
| 205 } |
| OLD | NEW |