Index: chrome/browser/chromeos/mobile/mobile_activator_unittest.cc |
diff --git a/chrome/browser/chromeos/mobile/mobile_activator_unittest.cc b/chrome/browser/chromeos/mobile/mobile_activator_unittest.cc |
index 563a06a220d5b8a6d3d72dd6a84b1d569be29bab..4a680fb2bee063c8427134acb8e3f7389646ac7b 100644 |
--- a/chrome/browser/chromeos/mobile/mobile_activator_unittest.cc |
+++ b/chrome/browser/chromeos/mobile/mobile_activator_unittest.cc |
@@ -6,6 +6,8 @@ |
#include "chrome/browser/chromeos/cros/mock_network_library.h" |
#include "chrome/browser/chromeos/cros/network_library.h" |
+#include "chrome/browser/chromeos/net/connectivity_state_helper.h" |
+#include "chrome/browser/chromeos/net/mock_connectivity_state_helper.h" |
#include "content/public/browser/browser_thread.h" |
#include "testing/gmock/include/gmock/gmock.h" |
#include "testing/gtest/include/gtest/gtest.h" |
@@ -64,7 +66,6 @@ class TestMobileActivator : public MobileActivator { |
private: |
MOCK_CONST_METHOD0(GetNetworkLibrary, NetworkLibrary*(void)); |
MOCK_CONST_METHOD1(DCheckOnThread, void(const BrowserThread::ID id)); |
- |
MockNetworkLibrary* mock_network_library_; |
CellularNetwork* cellular_network_; |
@@ -80,8 +81,14 @@ class MobileActivatorTest : public testing::Test { |
virtual ~MobileActivatorTest() {} |
protected: |
- virtual void SetUp() {} |
- virtual void TearDown() {} |
+ virtual void SetUp() { |
+ mock_connectivity_state_helper_ = new MockConnectivityStateHelper(); |
+ ConnectivityStateHelper::InitializeForTesting( |
+ mock_connectivity_state_helper_); |
+ } |
+ virtual void TearDown() { |
+ ConnectivityStateHelper::Shutdown(); |
+ } |
void set_activator_state(const MobileActivator::PlanActivationState state) { |
mobile_activator_.state_ = state; |
@@ -96,6 +103,8 @@ class MobileActivatorTest : public testing::Test { |
MockNetworkLibrary network_library_; |
stevenjb
2013/03/11 23:11:05
Here too - I'd prefer to convert this all at once.
stevenjb
2013/03/12 15:53:34
And this.
|
MockCellularNetwork cellular_network_; |
TestMobileActivator mobile_activator_; |
+ MockConnectivityStateHelper* mock_connectivity_state_helper_; |
+ |
private: |
DISALLOW_COPY_AND_ASSIGN(MobileActivatorTest); |
}; |
@@ -234,7 +243,7 @@ TEST_F(MobileActivatorTest, ReconnectOnDisconnectFromPaymentPortal) { |
} |
TEST_F(MobileActivatorTest, StartAtStart) { |
- EXPECT_CALL(network_library_, |
+ EXPECT_CALL(*mock_connectivity_state_helper_, |
AddNetworkManagerObserver(Eq(&mobile_activator_))); |
EXPECT_CALL(network_library_, HasRecentCellularPlanPayment()). |
WillOnce(Return(false)); |