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

Unified Diff: chrome/browser/chromeos/tether/tether_service_unittest.cc

Issue 2900903002: Create a FakeTetherService, which stubs out TetherService for development. (Closed)
Patch Set: Fix TetherService tests. Created 3 years, 7 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 | « chrome/browser/chromeos/tether/tether_service_factory.cc ('k') | chromeos/chromeos_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/tether/tether_service_unittest.cc
diff --git a/chrome/browser/chromeos/tether/tether_service_unittest.cc b/chrome/browser/chromeos/tether/tether_service_unittest.cc
index 00752a106e0b54f05486bbce80b39d17765d4acc..2c5c8e69430d14b100cfde80efe53e65f95a09a0 100644
--- a/chrome/browser/chromeos/tether/tether_service_unittest.cc
+++ b/chrome/browser/chromeos/tether/tether_service_unittest.cc
@@ -102,9 +102,6 @@ class TetherServiceTest : public chromeos::NetworkStateTest {
chromeos::NetworkConnect::Initialize(nullptr);
chromeos::NetworkHandler::Initialize();
- base::CommandLine::ForCurrentProcess()->AppendSwitch(
- chromeos::switches::kEnableTether);
-
TestingProfile::Builder builder;
profile_ = builder.Build();
@@ -234,16 +231,17 @@ TEST_F(TetherServiceTest, TestScreenLock) {
chromeos::NetworkTypePattern::Tether()));
}
-TEST_F(TetherServiceTest, TestFeatureFlag) {
- base::CommandLine::Reset();
- base::CommandLine::Init(0, nullptr);
+TEST_F(TetherServiceTest, TestFeatureFlagDisabled) {
+ EXPECT_FALSE(TetherService::Get(profile_.get()));
+}
- CreateTetherService();
+TEST_F(TetherServiceTest, TestFeatureFlagEnabled) {
+ base::CommandLine::ForCurrentProcess()->AppendSwitch(
+ chromeos::switches::kEnableTether);
- EXPECT_EQ(
- chromeos::NetworkStateHandler::TechnologyState::TECHNOLOGY_UNAVAILABLE,
- network_state_handler()->GetTechnologyState(
- chromeos::NetworkTypePattern::Tether()));
+ TetherService* tether_service = TetherService::Get(profile_.get());
+ EXPECT_TRUE(tether_service);
+ tether_service->Shutdown();
}
TEST_F(TetherServiceTest, TestNoTetherHosts) {
« no previous file with comments | « chrome/browser/chromeos/tether/tether_service_factory.cc ('k') | chromeos/chromeos_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698