Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2807)

Unified Diff: chrome/browser/extensions/api/bluetooth/bluetooth_apitest.cc

Issue 13224004: Bluetooth: remove private members from BluetoothAdapter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comments Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/api/bluetooth/bluetooth_event_router_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/bluetooth/bluetooth_apitest.cc
diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_apitest.cc b/chrome/browser/extensions/api/bluetooth/bluetooth_apitest.cc
index 63828ff93c40e4901696867369e9e06dd2cc9a11..c0418593c79d78416ea5a1d425ef17fa34c89959 100644
--- a/chrome/browser/extensions/api/bluetooth/bluetooth_apitest.cc
+++ b/chrome/browser/extensions/api/bluetooth/bluetooth_apitest.cc
@@ -56,8 +56,7 @@ class BluetoothApiTest : public ExtensionApiTest {
void SetUpMockAdapter() {
// The browser will clean this up when it is torn down
- mock_adapter_ = new testing::StrictMock<MockBluetoothAdapter>(
- kAdapterAddress, kName);
+ mock_adapter_ = new testing::StrictMock<MockBluetoothAdapter>();
event_router()->SetAdapterForTest(mock_adapter_);
device1_.reset(new testing::NiceMock<MockBluetoothDevice>(
@@ -143,6 +142,10 @@ static void CallConnectToServiceCallback(
} // namespace
IN_PROC_BROWSER_TEST_F(BluetoothApiTest, OnAdapterStateChanged) {
+ EXPECT_CALL(*mock_adapter_, address())
+ .WillOnce(testing::Return(kAdapterAddress));
+ EXPECT_CALL(*mock_adapter_, name())
+ .WillOnce(testing::Return(kName));
EXPECT_CALL(*mock_adapter_, IsPresent())
.WillOnce(testing::Return(false));
EXPECT_CALL(*mock_adapter_, IsPowered())
@@ -311,6 +314,10 @@ IN_PROC_BROWSER_TEST_F(BluetoothApiTest, DiscoveryCallback) {
}
IN_PROC_BROWSER_TEST_F(BluetoothApiTest, DiscoveryInProgress) {
+ EXPECT_CALL(*mock_adapter_, address())
+ .WillOnce(testing::Return(kAdapterAddress));
+ EXPECT_CALL(*mock_adapter_, name())
+ .WillOnce(testing::Return(kName));
EXPECT_CALL(*mock_adapter_, IsPresent())
.WillOnce(testing::Return(true));
EXPECT_CALL(*mock_adapter_, IsPowered())
@@ -362,6 +369,10 @@ IN_PROC_BROWSER_TEST_F(BluetoothApiTest, Events) {
ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("bluetooth/events")));
EXPECT_TRUE(listener.WaitUntilSatisfied());
+ EXPECT_CALL(*mock_adapter_, address())
+ .WillOnce(testing::Return(kAdapterAddress));
+ EXPECT_CALL(*mock_adapter_, name())
+ .WillOnce(testing::Return(kName));
EXPECT_CALL(*mock_adapter_, IsPresent())
.WillOnce(testing::Return(false));
EXPECT_CALL(*mock_adapter_, IsPowered())
@@ -370,6 +381,10 @@ IN_PROC_BROWSER_TEST_F(BluetoothApiTest, Events) {
.WillOnce(testing::Return(false));
event_router()->AdapterPoweredChanged(mock_adapter_, false);
+ EXPECT_CALL(*mock_adapter_, address())
+ .WillOnce(testing::Return(kAdapterAddress));
+ EXPECT_CALL(*mock_adapter_, name())
+ .WillOnce(testing::Return(kName));
EXPECT_CALL(*mock_adapter_, IsPresent())
.WillOnce(testing::Return(true));
EXPECT_CALL(*mock_adapter_, IsPowered())
@@ -378,6 +393,10 @@ IN_PROC_BROWSER_TEST_F(BluetoothApiTest, Events) {
.WillOnce(testing::Return(true));
event_router()->AdapterPresentChanged(mock_adapter_, true);
+ EXPECT_CALL(*mock_adapter_, address())
+ .WillOnce(testing::Return(kAdapterAddress));
+ EXPECT_CALL(*mock_adapter_, name())
+ .WillOnce(testing::Return(kName));
EXPECT_CALL(*mock_adapter_, IsPresent())
.WillOnce(testing::Return(true));
EXPECT_CALL(*mock_adapter_, IsPowered())
« no previous file with comments | « no previous file | chrome/browser/extensions/api/bluetooth/bluetooth_event_router_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698