Skip to content

Commit

Permalink
Revert "Add wizard_controller unit test"
Browse files Browse the repository at this point in the history
This reverts commit d8a3b5f.

Reason for revert: WizardControllerTest.ConsumerOobeFlowShouldContinueOnNonCriticalUpdate
timeouts on https://ci.chromium.org/ui/p/chromium/builders/ci/linux-cfm-rel

Original change's description:
> Add wizard_controller unit test
>
> Add a file for wizard_controller unit tests.
> It includes a test that shows how to connect to a network, send user actions, and wait for OOBE screens.
>
> Move rollback tests over from browsertest to the unit test file. They
> never needed a browser test set-up.
>
> Bug: b:280794386
> Change-Id: I5e3f7f1f8899b777165dc4e510beadf93d1f198b
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4746803
> Commit-Queue: Miriam Polzer <mpolzer@google.com>
> Reviewed-by: Jeroen Dhollander <jeroendh@google.com>
> Reviewed-by: Danila Kuzmin <dkuzmin@google.com>
> Reviewed-by: Xiaoqian Dai <xdai@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1185104}

Bug: b:280794386
Change-Id: I52b55e31f7d08fad5b55e700f999864ee10c06fa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4793570
Commit-Queue: Andrew Rayskiy <greengrape@google.com>
Owners-Override: Andrew Rayskiy <greengrape@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1185132}
  • Loading branch information
Andrew Rayskiy authored and Chromium LUCI CQ committed Aug 18, 2023
1 parent bd406cd commit 3399867
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 344 deletions.
6 changes: 0 additions & 6 deletions ash/test/ash_test_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -674,12 +674,6 @@ NoSessionAshTestBase::NoSessionAshTestBase(
set_start_session(false);
}

NoSessionAshTestBase::NoSessionAshTestBase(
std::unique_ptr<base::test::TaskEnvironment> task_environment)
: AshTestBase(std::move(task_environment)) {
set_start_session(false);
}

NoSessionAshTestBase::~NoSessionAshTestBase() = default;

} // namespace ash
2 changes: 0 additions & 2 deletions ash/test/ash_test_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,6 @@ class NoSessionAshTestBase : public AshTestBase {
NoSessionAshTestBase();
explicit NoSessionAshTestBase(
base::test::TaskEnvironment::TimeSource time_source);
explicit NoSessionAshTestBase(
std::unique_ptr<base::test::TaskEnvironment> task_environment);

NoSessionAshTestBase(const NoSessionAshTestBase&) = delete;
NoSessionAshTestBase& operator=(const NoSessionAshTestBase&) = delete;
Expand Down
2 changes: 0 additions & 2 deletions chrome/browser/ash/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -5476,7 +5476,6 @@ source_set("unit_tests") {
"login/users/user_manager_unittest.cc",
"login/version_updater/update_time_estimator_unittest.cc",
"login/version_updater/version_updater_unittest.cc",
"login/wizard_controller_unittest.cc",
"mobile/mobile_activator_unittest.cc",
"nearby/bluetooth_adapter_manager_unittest.cc",
"nearby/nearby_process_manager_impl_unittest.cc",
Expand Down Expand Up @@ -6017,7 +6016,6 @@ source_set("unit_tests") {
"//chromeos/ash/components/dbus/kerberos:kerberos_proto",
"//chromeos/ash/components/dbus/lorgnette_manager",
"//chromeos/ash/components/dbus/lorgnette_manager:lorgnette_proto",
"//chromeos/ash/components/dbus/oobe_config",
"//chromeos/ash/components/dbus/pciguard",
"//chromeos/ash/components/dbus/resourced",
"//chromeos/ash/components/dbus/seneschal",
Expand Down
14 changes: 5 additions & 9 deletions chrome/browser/ash/login/screens/welcome_screen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include "ash/constants/ash_features.h"
#include "ash/constants/ash_switches.h"
#include "base/check_is_test.h"
#include "base/command_line.h"
#include "base/containers/contains.h"
#include "base/functional/bind.h"
Expand Down Expand Up @@ -196,14 +195,11 @@ WelcomeScreen::WelcomeScreen(base::WeakPtr<WelcomeView> view,
input_method::InputMethodManager::Get()->AddObserver(this);

AccessibilityManager* accessibility_manager = AccessibilityManager::Get();
if (accessibility_manager) {
accessibility_subscription_ = accessibility_manager->RegisterCallback(
base::BindRepeating(&WelcomeScreen::OnAccessibilityStatusChanged,
base::Unretained(this)));
UpdateA11yState();
} else {
CHECK_IS_TEST();
}
CHECK(accessibility_manager);
accessibility_subscription_ = accessibility_manager->RegisterCallback(
base::BindRepeating(&WelcomeScreen::OnAccessibilityStatusChanged,
base::Unretained(this)));
UpdateA11yState();
}

WelcomeScreen::~WelcomeScreen() {
Expand Down
30 changes: 7 additions & 23 deletions chrome/browser/ash/login/ui/fake_login_display_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include "base/notreached.h"
#include "chrome/browser/ash/login/wizard_controller.h"
#include "chrome/browser/ui/webui/ash/login/user_creation_screen_handler.h"
#include "components/session_manager/core/session_manager.h"

namespace ash {
Expand Down Expand Up @@ -50,7 +49,7 @@ views::Widget* FakeLoginDisplayHost::GetLoginWindowWidget() const {
}

OobeUI* FakeLoginDisplayHost::GetOobeUI() const {
return oobe_ui_;
return nullptr;
}

content::WebContents* FakeLoginDisplayHost::GetOobeWebContents() const {
Expand All @@ -74,15 +73,11 @@ void FakeLoginDisplayHost::FinalizeImmediately() {}
void FakeLoginDisplayHost::SetStatusAreaVisible(bool visible) {}

void FakeLoginDisplayHost::StartWizard(OobeScreenId first_screen) {
if (wizard_controller_) {
wizard_controller_->AdvanceToScreen(first_screen);
} else {
wizard_controller_ =
std::make_unique<WizardController>(wizard_context_.get());
wizard_controller_ =
std::make_unique<WizardController>(wizard_context_.get());

fake_screen_ = std::make_unique<FakeBaseScreen>(first_screen);
wizard_controller_->SetCurrentScreenForTesting(fake_screen_.get());
}
fake_screen_ = std::make_unique<FakeBaseScreen>(first_screen);
wizard_controller_->SetCurrentScreenForTesting(fake_screen_.get());
}

WizardController* FakeLoginDisplayHost::GetWizardController() {
Expand All @@ -94,17 +89,15 @@ KioskLaunchController* FakeLoginDisplayHost::GetKioskLaunchController() {
}

WizardContext* FakeLoginDisplayHost::GetWizardContext() {
return wizard_context_.get();
return nullptr;
}

void FakeLoginDisplayHost::StartUserAdding(
base::OnceClosure completion_callback) {}

void FakeLoginDisplayHost::CancelUserAdding() {}

void FakeLoginDisplayHost::StartSignInScreen() {
StartWizard(UserCreationView::kScreenId);
}
void FakeLoginDisplayHost::StartSignInScreen() {}

void FakeLoginDisplayHost::StartKiosk(const KioskAppId& kiosk_app_id,
bool is_auto_launch) {}
Expand Down Expand Up @@ -200,13 +193,4 @@ bool FakeLoginDisplayHost::GetKeyboardRemappedPrefValue(
return false;
}

void FakeLoginDisplayHost::SetOobeUI(raw_ptr<OobeUI> oobe_ui) {
oobe_ui_ = oobe_ui;
}

void FakeLoginDisplayHost::SetWizardController(
std::unique_ptr<WizardController> wizard_controller) {
wizard_controller_ = std::move(wizard_controller);
}

} // namespace ash
5 changes: 0 additions & 5 deletions chrome/browser/ash/login/ui/fake_login_display_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,9 @@ class FakeLoginDisplayHost : public LoginDisplayHost {
base::WeakPtr<ash::quick_start::TargetDeviceBootstrapController>
GetQuickStartBootstrapController() final;

void SetOobeUI(raw_ptr<OobeUI> oobe_ui);
void SetWizardController(std::unique_ptr<WizardController> wizard_controller);

private:
class FakeBaseScreen;

raw_ptr<OobeUI> oobe_ui_;

// SessionManager is required by the constructor of WizardController.
std::unique_ptr<session_manager::SessionManager> session_manager_;
std::unique_ptr<FakeBaseScreen> fake_screen_;
Expand Down

0 comments on commit 3399867

Please sign in to comment.