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

Unified Diff: chrome/browser/chromeos/mobile/mobile_activator_unittest.cc

Issue 12729002: Add a unified observer to replace NetworkManagerObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix mobile_activator_unittest 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
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));

Powered by Google App Engine
This is Rietveld 408576698