Index: chrome/browser/chromeos/bluetooth/bluetooth_adapter_chromeos_unittest.cc |
diff --git a/chrome/browser/chromeos/bluetooth/bluetooth_adapter_unittest.cc b/chrome/browser/chromeos/bluetooth/bluetooth_adapter_chromeos_unittest.cc |
similarity index 87% |
rename from chrome/browser/chromeos/bluetooth/bluetooth_adapter_unittest.cc |
rename to chrome/browser/chromeos/bluetooth/bluetooth_adapter_chromeos_unittest.cc |
index 8b3f1b4e2361ab3ac292da97687209103ad25227..f3be4169428f4867ec4fdf1303f963d43d8f1266 100644 |
--- a/chrome/browser/chromeos/bluetooth/bluetooth_adapter_unittest.cc |
+++ b/chrome/browser/chromeos/bluetooth/bluetooth_adapter_chromeos_unittest.cc |
@@ -5,6 +5,8 @@ |
#include <iostream> |
#include "chrome/browser/chromeos/bluetooth/bluetooth_adapter.h" |
+#include "chrome/browser/chromeos/bluetooth/bluetooth_adapter_chromeos.h" |
+#include "chrome/browser/chromeos/bluetooth/bluetooth_adapter_factory.h" |
#include "chrome/browser/chromeos/bluetooth/test/mock_bluetooth_adapter.h" |
#include "chromeos/dbus/mock_bluetooth_adapter_client.h" |
#include "chromeos/dbus/mock_bluetooth_manager_client.h" |
@@ -50,7 +52,8 @@ TEST_F(BluetoothAdapterTest, DefaultAdapterNotPresent) { |
EXPECT_CALL(*mock_manager_client_, DefaultAdapter(_)) |
.WillOnce(SaveArg<0>(&adapter_callback)); |
- scoped_refptr<BluetoothAdapter> adapter = BluetoothAdapter::DefaultAdapter(); |
+ scoped_refptr<BluetoothAdapter> adapter = |
+ BluetoothAdapterFactory::DefaultAdapter(); |
bryeung
2012/09/18 19:18:39
This doesn't really make sense: you're assuming th
youngki
2012/09/19 01:13:55
I didn't do it on this CL but what I am planning o
|
// Call the adapter callback; make out it failed. |
// BluetoothAdapter::Observer::AdapterPresentChanged must not be called. |
@@ -77,7 +80,8 @@ TEST_F(BluetoothAdapterTest, DefaultAdapterWithAddress) { |
EXPECT_CALL(*mock_manager_client_, DefaultAdapter(_)) |
.WillOnce(SaveArg<0>(&adapter_callback)); |
- scoped_refptr<BluetoothAdapter> adapter = BluetoothAdapter::DefaultAdapter(); |
+ scoped_refptr<BluetoothAdapter> adapter = |
+ BluetoothAdapterFactory::DefaultAdapter(); |
// Call the adapter callback; |
// BluetoothAdapterClient::GetProperties will be called once to obtain |
@@ -114,7 +118,8 @@ TEST_F(BluetoothAdapterTest, DefaultAdapterWithoutAddress) { |
EXPECT_CALL(*mock_manager_client_, DefaultAdapter(_)) |
.WillOnce(SaveArg<0>(&adapter_callback)); |
- scoped_refptr<BluetoothAdapter> adapter = BluetoothAdapter::DefaultAdapter(); |
+ scoped_refptr<BluetoothAdapter> adapter = |
+ BluetoothAdapterFactory::DefaultAdapter(); |
// Call the adapter callback; |
// BluetoothAdapterClient::GetProperties will be called once to obtain |
@@ -144,7 +149,10 @@ TEST_F(BluetoothAdapterTest, DefaultAdapterWithoutAddress) { |
EXPECT_CALL(adapter_observer, AdapterPresentChanged(adapter.get(), true)) |
.Times(1); |
- static_cast<BluetoothAdapterClient::Observer*>(adapter.get()) |
+ BluetoothAdapterChromeOs* adapter_chromeos = |
+ static_cast<BluetoothAdapterChromeOs*>(adapter.get()); |
+ |
+ static_cast<BluetoothAdapterClient::Observer*>(adapter_chromeos) |
->AdapterPropertyChanged(adapter_path, |
adapter_properties.address.name()); |
@@ -164,7 +172,8 @@ TEST_F(BluetoothAdapterTest, DefaultAdapterBecomesPresentWithAddress) { |
EXPECT_CALL(*mock_manager_client_, DefaultAdapter(_)) |
.WillOnce(SaveArg<0>(&adapter_callback)); |
- scoped_refptr<BluetoothAdapter> adapter = BluetoothAdapter::DefaultAdapter(); |
+ scoped_refptr<BluetoothAdapter> adapter = |
+ BluetoothAdapterFactory::DefaultAdapter(); |
// Call the adapter callback; make out it failed. |
adapter_callback.Run(dbus::ObjectPath(""), false); |
@@ -185,7 +194,10 @@ TEST_F(BluetoothAdapterTest, DefaultAdapterBecomesPresentWithAddress) { |
EXPECT_CALL(adapter_observer, AdapterPresentChanged(adapter.get(), true)) |
.Times(1); |
- static_cast<BluetoothManagerClient::Observer*>(adapter.get()) |
+ BluetoothAdapterChromeOs* adapter_chromeos = |
+ static_cast<BluetoothAdapterChromeOs*>(adapter.get()); |
+ |
+ static_cast<BluetoothManagerClient::Observer*>(adapter_chromeos) |
->DefaultAdapterChanged(adapter_path); |
// Adapter should be present with the new address. |
@@ -206,7 +218,8 @@ TEST_F(BluetoothAdapterTest, DefaultAdapterReplacedWithAddress) { |
EXPECT_CALL(*mock_manager_client_, DefaultAdapter(_)) |
.WillOnce(SaveArg<0>(&adapter_callback)); |
- scoped_refptr<BluetoothAdapter> adapter = BluetoothAdapter::DefaultAdapter(); |
+ scoped_refptr<BluetoothAdapter> adapter = |
+ BluetoothAdapterFactory::DefaultAdapter(); |
// Call the adapter callback; |
// BluetoothAdapterClient::GetProperties will be called once to obtain |
@@ -239,7 +252,10 @@ TEST_F(BluetoothAdapterTest, DefaultAdapterReplacedWithAddress) { |
EXPECT_CALL(adapter_observer, AdapterPresentChanged(adapter.get(), true)) |
.Times(1); |
- static_cast<BluetoothManagerClient::Observer*>(adapter.get()) |
+ BluetoothAdapterChromeOs* adapter_chromeos = |
+ static_cast<BluetoothAdapterChromeOs*>(adapter.get()); |
+ |
+ static_cast<BluetoothManagerClient::Observer*>(adapter_chromeos) |
->DefaultAdapterChanged(new_adapter_path); |
// Adapter should be present with the new address. |
@@ -258,7 +274,8 @@ TEST_F(BluetoothAdapterTest, DefaultAdapterBecomesPresentWithoutAddress) { |
EXPECT_CALL(*mock_manager_client_, DefaultAdapter(_)) |
.WillOnce(SaveArg<0>(&adapter_callback)); |
- scoped_refptr<BluetoothAdapter> adapter = BluetoothAdapter::DefaultAdapter(); |
+ scoped_refptr<BluetoothAdapter> adapter = |
+ BluetoothAdapterFactory::DefaultAdapter(); |
// Call the adapter callback; make out it failed. |
adapter_callback.Run(dbus::ObjectPath(""), false); |
@@ -278,7 +295,10 @@ TEST_F(BluetoothAdapterTest, DefaultAdapterBecomesPresentWithoutAddress) { |
EXPECT_CALL(adapter_observer, AdapterPresentChanged(adapter.get(), _)) |
.Times(0); |
- static_cast<BluetoothManagerClient::Observer*>(adapter.get()) |
+ BluetoothAdapterChromeOs* adapter_chromeos = |
+ static_cast<BluetoothAdapterChromeOs*>(adapter.get()); |
+ |
+ static_cast<BluetoothManagerClient::Observer*>(adapter_chromeos) |
->DefaultAdapterChanged(adapter_path); |
// Adapter should not be present yet. |
@@ -291,7 +311,7 @@ TEST_F(BluetoothAdapterTest, DefaultAdapterBecomesPresentWithoutAddress) { |
EXPECT_CALL(adapter_observer, AdapterPresentChanged(adapter.get(), true)) |
.Times(1); |
- static_cast<BluetoothAdapterClient::Observer*>(adapter.get()) |
+ static_cast<BluetoothAdapterClient::Observer*>(adapter_chromeos) |
->AdapterPropertyChanged(adapter_path, |
adapter_properties.address.name()); |
@@ -313,7 +333,8 @@ TEST_F(BluetoothAdapterTest, DefaultAdapterReplacedWithoutAddress) { |
EXPECT_CALL(*mock_manager_client_, DefaultAdapter(_)) |
.WillOnce(SaveArg<0>(&adapter_callback)); |
- scoped_refptr<BluetoothAdapter> adapter = BluetoothAdapter::DefaultAdapter(); |
+ scoped_refptr<BluetoothAdapter> adapter = |
+ BluetoothAdapterFactory::DefaultAdapter(); |
// Call the adapter callback; |
// BluetoothAdapterClient::GetProperties will be called once to obtain |
@@ -342,7 +363,10 @@ TEST_F(BluetoothAdapterTest, DefaultAdapterReplacedWithoutAddress) { |
EXPECT_CALL(adapter_observer, AdapterPresentChanged(adapter.get(), false)) |
.Times(1); |
- static_cast<BluetoothManagerClient::Observer*>(adapter.get()) |
+ BluetoothAdapterChromeOs* adapter_chromeos = |
+ static_cast<BluetoothAdapterChromeOs*>(adapter.get()); |
+ |
+ static_cast<BluetoothManagerClient::Observer*>(adapter_chromeos) |
->DefaultAdapterChanged(new_adapter_path); |
// Adapter should be now marked not present. |
@@ -355,7 +379,7 @@ TEST_F(BluetoothAdapterTest, DefaultAdapterReplacedWithoutAddress) { |
EXPECT_CALL(adapter_observer, AdapterPresentChanged(adapter.get(), true)) |
.Times(1); |
- static_cast<BluetoothAdapterClient::Observer*>(adapter.get()) |
+ static_cast<BluetoothAdapterClient::Observer*>(adapter_chromeos) |
->AdapterPropertyChanged(new_adapter_path, |
new_adapter_properties.address.name()); |
@@ -375,7 +399,8 @@ TEST_F(BluetoothAdapterTest, DefaultAdapterRemoved) { |
EXPECT_CALL(*mock_manager_client_, DefaultAdapter(_)) |
.WillOnce(SaveArg<0>(&adapter_callback)); |
- scoped_refptr<BluetoothAdapter> adapter = BluetoothAdapter::DefaultAdapter(); |
+ scoped_refptr<BluetoothAdapter> adapter = |
+ BluetoothAdapterFactory::DefaultAdapter(); |
// Call the adapter callback; |
// BluetoothAdapterClient::GetProperties will be called once to obtain |
@@ -397,7 +422,10 @@ TEST_F(BluetoothAdapterTest, DefaultAdapterRemoved) { |
EXPECT_CALL(adapter_observer, AdapterPresentChanged(adapter.get(), false)) |
.Times(1); |
- static_cast<BluetoothManagerClient::Observer*>(adapter.get()) |
+ BluetoothAdapterChromeOs* adapter_chromeos = |
+ static_cast<BluetoothAdapterChromeOs*>(adapter.get()); |
+ |
+ static_cast<BluetoothManagerClient::Observer*>(adapter_chromeos) |
->AdapterRemoved(adapter_path); |
// Adapter should be no longer present. |
@@ -414,7 +442,8 @@ TEST_F(BluetoothAdapterTest, DefaultAdapterWithoutAddressRemoved) { |
EXPECT_CALL(*mock_manager_client_, DefaultAdapter(_)) |
.WillOnce(SaveArg<0>(&adapter_callback)); |
- scoped_refptr<BluetoothAdapter> adapter = BluetoothAdapter::DefaultAdapter(); |
+ scoped_refptr<BluetoothAdapter> adapter = |
+ BluetoothAdapterFactory::DefaultAdapter(); |
// Call the adapter callback; |
// BluetoothAdapterClient::GetProperties will be called once to obtain |
@@ -435,7 +464,10 @@ TEST_F(BluetoothAdapterTest, DefaultAdapterWithoutAddressRemoved) { |
EXPECT_CALL(adapter_observer, AdapterPresentChanged(adapter.get(), _)) |
.Times(0); |
- static_cast<BluetoothManagerClient::Observer*>(adapter.get()) |
+ BluetoothAdapterChromeOs* adapter_chromeos = |
+ static_cast<BluetoothAdapterChromeOs*>(adapter.get()); |
+ |
+ static_cast<BluetoothManagerClient::Observer*>(adapter_chromeos) |
->AdapterRemoved(adapter_path); |
// Adapter should be still no longer present. |