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/stringprintf.h" | 7 #include "base/stringprintf.h" |
8 #include "chrome/browser/extensions/api/bluetooth/bluetooth_api.h" | 8 #include "chrome/browser/extensions/api/bluetooth/bluetooth_api.h" |
9 #include "chrome/browser/extensions/api/bluetooth/bluetooth_event_router.h" | 9 #include "chrome/browser/extensions/api/bluetooth/bluetooth_event_router.h" |
10 #include "chrome/browser/extensions/api/permissions/permissions_api.h" | 10 #include "chrome/browser/extensions/api/permissions/permissions_api.h" |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 ASSERT_TRUE(LoadExtension( | 442 ASSERT_TRUE(LoadExtension( |
443 test_data_dir_.AppendASCII("bluetooth/get_devices_error"))); | 443 test_data_dir_.AppendASCII("bluetooth/get_devices_error"))); |
444 EXPECT_TRUE(listener.WaitUntilSatisfied()); | 444 EXPECT_TRUE(listener.WaitUntilSatisfied()); |
445 | 445 |
446 listener.Reply("go"); | 446 listener.Reply("go"); |
447 | 447 |
448 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 448 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
449 } | 449 } |
450 | 450 |
451 IN_PROC_BROWSER_TEST_F(BluetoothApiTest, Permissions) { | 451 IN_PROC_BROWSER_TEST_F(BluetoothApiTest, Permissions) { |
452 PermissionsRequestFunction::SetAutoConfirmForTests(true); | 452 RequestPermissionsFunction::SetAutoConfirmForTests(true); |
453 PermissionsRequestFunction::SetIgnoreUserGestureForTests(true); | 453 RequestPermissionsFunction::SetIgnoreUserGestureForTests(true); |
454 | 454 |
455 EXPECT_CALL(*mock_adapter_, GetDevice(device1_->address())) | 455 EXPECT_CALL(*mock_adapter_, GetDevice(device1_->address())) |
456 .WillOnce(testing::Return(device1_.get())); | 456 .WillOnce(testing::Return(device1_.get())); |
457 EXPECT_CALL(*device1_, | 457 EXPECT_CALL(*device1_, |
458 ConnectToService(testing::_, testing::_)) | 458 ConnectToService(testing::_, testing::_)) |
459 .WillOnce(testing::Invoke(CallConnectToServiceCallback)); | 459 .WillOnce(testing::Invoke(CallConnectToServiceCallback)); |
460 | 460 |
461 EXPECT_TRUE(RunExtensionTest("bluetooth/permissions")) << message_; | 461 EXPECT_TRUE(RunExtensionTest("bluetooth/permissions")) << message_; |
462 } | 462 } |
OLD | NEW |