| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "chrome/browser/chromeos/policy/affiliation_test_helper.h" | 9 #include "chrome/browser/chromeos/policy/affiliation_test_helper.h" |
| 10 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" | 10 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 class UserAffiliationBrowserTest | 34 class UserAffiliationBrowserTest |
| 35 : public InProcessBrowserTest, | 35 : public InProcessBrowserTest, |
| 36 public ::testing::WithParamInterface<Params> { | 36 public ::testing::WithParamInterface<Params> { |
| 37 public: | 37 public: |
| 38 UserAffiliationBrowserTest() { set_exit_when_last_browser_closes(false); } | 38 UserAffiliationBrowserTest() { set_exit_when_last_browser_closes(false); } |
| 39 | 39 |
| 40 protected: | 40 protected: |
| 41 // InProcessBrowserTest | 41 // InProcessBrowserTest |
| 42 void SetUpCommandLine(base::CommandLine* command_line) override { | 42 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 43 InProcessBrowserTest::SetUpCommandLine(command_line); | |
| 44 affiliation_test_helper::AppendCommandLineSwitchesForLoginManager( | 43 affiliation_test_helper::AppendCommandLineSwitchesForLoginManager( |
| 45 command_line); | 44 command_line); |
| 46 } | 45 } |
| 47 | 46 |
| 48 // InProcessBrowserTest | 47 // InProcessBrowserTest |
| 49 void SetUpInProcessBrowserTestFixture() override { | 48 void SetUpInProcessBrowserTestFixture() override { |
| 50 InProcessBrowserTest::SetUpInProcessBrowserTestFixture(); | |
| 51 | |
| 52 chromeos::FakeSessionManagerClient* fake_session_manager_client = | 49 chromeos::FakeSessionManagerClient* fake_session_manager_client = |
| 53 new chromeos::FakeSessionManagerClient; | 50 new chromeos::FakeSessionManagerClient; |
| 54 chromeos::DBusThreadManager::GetSetterForTesting()->SetSessionManagerClient( | 51 chromeos::DBusThreadManager::GetSetterForTesting()->SetSessionManagerClient( |
| 55 base::WrapUnique<chromeos::SessionManagerClient>( | 52 base::WrapUnique<chromeos::SessionManagerClient>( |
| 56 fake_session_manager_client)); | 53 fake_session_manager_client)); |
| 57 | 54 |
| 58 UserPolicyBuilder user_policy; | 55 UserPolicyBuilder user_policy; |
| 59 DevicePolicyCrosTestHelper test_helper; | 56 DevicePolicyCrosTestHelper test_helper; |
| 60 | 57 |
| 61 std::set<std::string> device_affiliation_ids; | 58 std::set<std::string> device_affiliation_ids; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 91 user_manager::UserManager::Get() | 88 user_manager::UserManager::Get() |
| 92 ->FindUser(AccountId::FromUserEmail(kAffiliatedUser)) | 89 ->FindUser(AccountId::FromUserEmail(kAffiliatedUser)) |
| 93 ->IsAffiliated()); | 90 ->IsAffiliated()); |
| 94 } | 91 } |
| 95 | 92 |
| 96 INSTANTIATE_TEST_CASE_P(AffiliationCheck, | 93 INSTANTIATE_TEST_CASE_P(AffiliationCheck, |
| 97 UserAffiliationBrowserTest, | 94 UserAffiliationBrowserTest, |
| 98 ::testing::Values(Params(true), Params(false))); | 95 ::testing::Values(Params(true), Params(false))); |
| 99 | 96 |
| 100 } // namespace policy | 97 } // namespace policy |
| OLD | NEW |