Chromium Code Reviews| Index: chrome/browser/chromeos/policy/consumer_management_notifier_factory_unittest.cc |
| diff --git a/chrome/browser/chromeos/policy/consumer_enrollment_handler_factory_unittest.cc b/chrome/browser/chromeos/policy/consumer_management_notifier_factory_unittest.cc |
| similarity index 66% |
| copy from chrome/browser/chromeos/policy/consumer_enrollment_handler_factory_unittest.cc |
| copy to chrome/browser/chromeos/policy/consumer_management_notifier_factory_unittest.cc |
| index 24bb84678a0a9c94ea9ee1a940a29e4c36d4b6ff..a0aa29a594661c6c0a6a5f8910aa2fb45c48c2de 100644 |
| --- a/chrome/browser/chromeos/policy/consumer_enrollment_handler_factory_unittest.cc |
| +++ b/chrome/browser/chromeos/policy/consumer_management_notifier_factory_unittest.cc |
| @@ -2,13 +2,14 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#include "chrome/browser/chromeos/policy/consumer_enrollment_handler_factory.h" |
| +#include "chrome/browser/chromeos/policy/consumer_management_notifier_factory.h" |
| #include "chrome/browser/browser_process.h" |
| #include "chrome/browser/browser_process_platform_part.h" |
| #include "chrome/browser/chromeos/login/users/fake_user_manager.h" |
| #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" |
| #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| +#include "chrome/browser/chromeos/policy/consumer_management_notifier.h" |
|
bartfab (slow)
2014/11/27 14:09:09
Nit: Where is this used?
davidyu
2014/11/28 02:45:26
It was used in a piece of testing code that didn't
|
| #include "chrome/browser/chromeos/policy/consumer_management_service.h" |
| #include "chrome/browser/chromeos/policy/fake_consumer_management_service.h" |
| #include "chrome/test/base/testing_browser_process.h" |
| @@ -22,18 +23,18 @@ const char* kTestUser = "test.user@chromium.org.test"; |
| namespace policy { |
| -class ConsumerEnrollmentHandlerFactoryTest : public testing::Test { |
| +class ConsumerManagementNotifierFactoryTest : public testing::Test { |
| public: |
| - ConsumerEnrollmentHandlerFactoryTest() |
| + ConsumerManagementNotifierFactoryTest() |
| : fake_service_(new FakeConsumerManagementService()), |
| fake_user_manager_(new chromeos::FakeUserManager()), |
| scoped_user_manager_enabler_(fake_user_manager_), |
| testing_profile_manager_(new TestingProfileManager( |
| TestingBrowserProcess::GetGlobal())) { |
| // Set up FakeConsumerManagementService. |
| - fake_service_->set_status(ConsumerManagementService::STATUS_ENROLLING); |
| - fake_service_->SetEnrollmentStage( |
| - ConsumerManagementService::ENROLLMENT_STAGE_OWNER_STORED); |
| + fake_service_->SetStatusAndEnrollmentStage( |
| + ConsumerManagementService::STATUS_UNENROLLED, |
| + ConsumerManagementService::ENROLLMENT_STAGE_NONE); |
| // Inject fake objects. |
| BrowserPolicyConnectorChromeOS* connector = |
| @@ -57,24 +58,17 @@ class ConsumerEnrollmentHandlerFactoryTest : public testing::Test { |
| scoped_ptr<TestingProfileManager> testing_profile_manager_; |
| }; |
| -TEST_F(ConsumerEnrollmentHandlerFactoryTest, ServiceIsCreated) { |
| +TEST_F(ConsumerManagementNotifierFactoryTest, ServiceIsCreated) { |
| Profile* profile = testing_profile_manager_->CreateTestingProfile(kTestOwner); |
| - EXPECT_TRUE(ConsumerEnrollmentHandlerFactory::GetForBrowserContext(profile)); |
| + EXPECT_TRUE( |
| + ConsumerManagementNotifierFactory::GetForBrowserContext(profile)); |
| } |
| -TEST_F(ConsumerEnrollmentHandlerFactoryTest, ServiceIsNotCreatedForNonOwner) { |
| +TEST_F(ConsumerManagementNotifierFactoryTest, |
| + ServiceIsNotCreatedForNonOwner) { |
| Profile* profile = testing_profile_manager_->CreateTestingProfile(kTestUser); |
| - EXPECT_FALSE(ConsumerEnrollmentHandlerFactory::GetForBrowserContext(profile)); |
| -} |
| - |
| -TEST_F(ConsumerEnrollmentHandlerFactoryTest, |
| - ServiceIsNotCreatedIfItHasNothingToDo) { |
| - fake_service_->set_status(ConsumerManagementService::STATUS_UNENROLLED); |
| - fake_service_->SetEnrollmentStage( |
| - ConsumerManagementService::ENROLLMENT_STAGE_NONE); |
| - |
| - Profile* profile = testing_profile_manager_->CreateTestingProfile(kTestOwner); |
| - EXPECT_FALSE(ConsumerEnrollmentHandlerFactory::GetForBrowserContext(profile)); |
| + EXPECT_FALSE( |
| + ConsumerManagementNotifierFactory::GetForBrowserContext(profile)); |
| } |
| } // namespace policy |