OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 bool is_auto_launch) override {} | 105 bool is_auto_launch) override {} |
106 void StartDemoAppLaunch() override {} | 106 void StartDemoAppLaunch() override {} |
107 void StartArcKiosk(const AccountId& account_id) override {} | 107 void StartArcKiosk(const AccountId& account_id) override {} |
108 | 108 |
109 private: | 109 private: |
110 DISALLOW_COPY_AND_ASSIGN(FakeLoginDisplayHost); | 110 DISALLOW_COPY_AND_ASSIGN(FakeLoginDisplayHost); |
111 }; | 111 }; |
112 | 112 |
113 } // namespace | 113 } // namespace |
114 | 114 |
115 // Bool parameter is used to implement ArcSessionOobeOptInTest tests for | 115 class ArcSessionManagerTestBase : public testing::Test { |
116 // managed/unmanaged users. To prevent ambiguous testing::Test inheritance | |
117 // implement derivation here, in base class. | |
118 class ArcSessionManagerTestBase : public testing::TestWithParam<bool> { | |
119 public: | 116 public: |
120 ArcSessionManagerTestBase() | 117 ArcSessionManagerTestBase() |
121 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP), | 118 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP), |
122 user_manager_enabler_(new chromeos::FakeChromeUserManager()) {} | 119 user_manager_enabler_(new chromeos::FakeChromeUserManager()) {} |
123 ~ArcSessionManagerTestBase() override = default; | 120 ~ArcSessionManagerTestBase() override = default; |
124 | 121 |
125 void SetUp() override { | 122 void SetUp() override { |
126 chromeos::DBusThreadManager::GetSetterForTesting()->SetSessionManagerClient( | 123 chromeos::DBusThreadManager::GetSetterForTesting()->SetSessionManagerClient( |
127 base::MakeUnique<chromeos::FakeSessionManagerClient>()); | 124 base::MakeUnique<chromeos::FakeSessionManagerClient>()); |
128 | 125 |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 CloseLoginDisplayHost(); | 637 CloseLoginDisplayHost(); |
641 EXPECT_FALSE(ArcSessionManager::IsOobeOptInActive()); | 638 EXPECT_FALSE(ArcSessionManager::IsOobeOptInActive()); |
642 GetFakeUserManager()->set_current_user_new(true); | 639 GetFakeUserManager()->set_current_user_new(true); |
643 EXPECT_FALSE(ArcSessionManager::IsOobeOptInActive()); | 640 EXPECT_FALSE(ArcSessionManager::IsOobeOptInActive()); |
644 CreateLoginDisplayHost(); | 641 CreateLoginDisplayHost(); |
645 EXPECT_TRUE(ArcSessionManager::IsOobeOptInActive()); | 642 EXPECT_TRUE(ArcSessionManager::IsOobeOptInActive()); |
646 } | 643 } |
647 | 644 |
648 class ArcSessionOobeOptInNegotiatorTest | 645 class ArcSessionOobeOptInNegotiatorTest |
649 : public ArcSessionOobeOptInTest, | 646 : public ArcSessionOobeOptInTest, |
650 public chromeos::ArcTermsOfServiceScreenActor { | 647 public chromeos::ArcTermsOfServiceScreenActor, |
| 648 public testing::WithParamInterface<bool> { |
651 public: | 649 public: |
652 ArcSessionOobeOptInNegotiatorTest() = default; | 650 ArcSessionOobeOptInNegotiatorTest() = default; |
653 | 651 |
654 void SetUp() override { | 652 void SetUp() override { |
655 ArcSessionOobeOptInTest::SetUp(); | 653 ArcSessionOobeOptInTest::SetUp(); |
656 | 654 |
657 AppendEnableArcOOBEOptInSwitch(); | 655 AppendEnableArcOOBEOptInSwitch(); |
658 | 656 |
659 ArcTermsOfServiceOobeNegotiator::SetArcTermsOfServiceScreenActorForTesting( | 657 ArcTermsOfServiceOobeNegotiator::SetArcTermsOfServiceScreenActorForTesting( |
660 this); | 658 this); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 MaybeWaitForDataRemoved(); | 772 MaybeWaitForDataRemoved(); |
775 EXPECT_EQ(ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE, | 773 EXPECT_EQ(ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE, |
776 arc_session_manager()->state()); | 774 arc_session_manager()->state()); |
777 CloseLoginDisplayHost(); | 775 CloseLoginDisplayHost(); |
778 ReportActorDestroyed(); | 776 ReportActorDestroyed(); |
779 EXPECT_EQ(ArcSessionManager::State::STOPPED, arc_session_manager()->state()); | 777 EXPECT_EQ(ArcSessionManager::State::STOPPED, arc_session_manager()->state()); |
780 EXPECT_FALSE(!IsManagedUser() && arc_session_manager()->IsArcEnabled()); | 778 EXPECT_FALSE(!IsManagedUser() && arc_session_manager()->IsArcEnabled()); |
781 } | 779 } |
782 | 780 |
783 } // namespace arc | 781 } // namespace arc |
OLD | NEW |