OOBE: EULA cleanup: Update tests [1/2]
Remove EULA Screen from tests. Bug: b:264170220 Change-Id: I443c7cdc97c1014a8cd5eba6b98031b9b5b5c70f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4129530 Reviewed-by: Danila Kuzmin <dkuzmin@google.com> Code-Coverage: Findit <findit-for-me@appspot.gserviceaccount.com> Commit-Queue: Osama Fathy <osamafathy@google.com> Cr-Commit-Position: refs/heads/main@{#1102130}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
bee80f7248
commit
1222510d1a
chrome
browser
ash
login
resources
chromeos
login
test_api
ui
webui
ash
test
@ -18,7 +18,6 @@
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/browser_process_platform_part.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/ui/webui/ash/login/eula_screen_handler.h"
|
||||
#include "chrome/browser/ui/webui/ash/login/hid_detection_screen_handler.h"
|
||||
#include "chrome/browser/ui/webui/ash/login/network_screen_handler.h"
|
||||
#include "chrome/browser/ui/webui/ash/login/update_screen_handler.h"
|
||||
@ -158,13 +157,13 @@ IN_PROC_BROWSER_TEST_F(OobeConfigurationTest, TestSwitchLanguageIME) {
|
||||
// Check that configuration lets correctly select a network by GUID.
|
||||
IN_PROC_BROWSER_TEST_F(OobeConfigurationTest, TestSelectNetwork) {
|
||||
LoadConfiguration();
|
||||
OobeScreenWaiter(OobeBaseTest::GetScreenAfterNetworkScreen()).Wait();
|
||||
OobeScreenWaiter(UpdateView::kScreenId).Wait();
|
||||
}
|
||||
|
||||
// Check that configuration would proceed if there is a connected network.
|
||||
IN_PROC_BROWSER_TEST_F(OobeConfigurationTest, TestSelectConnectedNetwork) {
|
||||
LoadConfiguration();
|
||||
OobeScreenWaiter(OobeBaseTest::GetScreenAfterNetworkScreen()).Wait();
|
||||
OobeScreenWaiter(UpdateView::kScreenId).Wait();
|
||||
}
|
||||
|
||||
// Check that configuration would not proceed with connected network if
|
||||
@ -189,7 +188,7 @@ IN_PROC_BROWSER_TEST_F(OobeConfigurationTest, TestAcceptEula) {
|
||||
// beginning.
|
||||
IN_PROC_BROWSER_TEST_F(OobeConfigurationTest, TestDeviceRequisition) {
|
||||
LoadConfiguration();
|
||||
OobeScreenWaiter(OobeBaseTest::GetScreenAfterNetworkScreen()).Wait();
|
||||
OobeScreenWaiter(UpdateView::kScreenId).Wait();
|
||||
|
||||
EXPECT_EQ(policy::EnrollmentRequisitionManager::GetDeviceRequisition(),
|
||||
"some_requisition");
|
||||
|
@ -46,7 +46,6 @@
|
||||
#include "chrome/browser/ui/webui/ash/login/demo_preferences_screen_handler.h"
|
||||
#include "chrome/browser/ui/webui/ash/login/demo_setup_screen_handler.h"
|
||||
#include "chrome/browser/ui/webui/ash/login/error_screen_handler.h"
|
||||
#include "chrome/browser/ui/webui/ash/login/eula_screen_handler.h"
|
||||
#include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h"
|
||||
#include "chrome/browser/ui/webui/ash/login/network_screen_handler.h"
|
||||
#include "chrome/browser/ui/webui/ash/login/welcome_screen_handler.h"
|
||||
@ -116,7 +115,6 @@ const test::UIPath kDemoSetupErrorDialogMessage = {kDemoSetupId,
|
||||
|
||||
const test::UIPath kArcTosDialog = {kArcTosId, "arcTosDialog"};
|
||||
const test::UIPath kArcTosAcceptButton = {kArcTosId, "arcTosAcceptButton"};
|
||||
const test::UIPath kArcTosDemoAppsNotice = {kArcTosId, "arcTosMetricsDemoApps"};
|
||||
const test::UIPath kArcTosBackButton = {kArcTosId, "arcTosBackButton"};
|
||||
const test::UIPath kArcTosNextButton = {kArcTosId, "arcTosNextButton"};
|
||||
|
||||
@ -372,36 +370,14 @@ class DemoSetupArcSupportedTest : public DemoSetupTestBase {
|
||||
test::LockDemoDeviceInstallAttributes();
|
||||
// TODO(b/246012796): If possible, re-enable waiting on the setup screen to
|
||||
// be shown
|
||||
if (features::IsOobeConsolidatedConsentEnabled()) {
|
||||
WaitForConsolidatedConsentScreen();
|
||||
|
||||
test::TapConsolidatedConsentAccept();
|
||||
} else {
|
||||
test::WaitForEulaScreen();
|
||||
test::TapEulaAccept();
|
||||
|
||||
WaitForArcTosScreen();
|
||||
|
||||
test::OobeJS().ExpectVisiblePath(kArcTosDemoAppsNotice);
|
||||
|
||||
AcceptArcTos();
|
||||
}
|
||||
WaitForConsolidatedConsentScreen();
|
||||
test::TapConsolidatedConsentAccept();
|
||||
}
|
||||
|
||||
void AcceptTermsAndExpectDemoSetupFailure() {
|
||||
if (features::IsOobeConsolidatedConsentEnabled()) {
|
||||
WaitForConsolidatedConsentScreen();
|
||||
test::TapConsolidatedConsentAccept();
|
||||
} else {
|
||||
test::WaitForEulaScreen();
|
||||
test::TapEulaAccept();
|
||||
WaitForConsolidatedConsentScreen();
|
||||
test::TapConsolidatedConsentAccept();
|
||||
|
||||
WaitForArcTosScreen();
|
||||
|
||||
test::OobeJS().ExpectVisiblePath(kArcTosDemoAppsNotice);
|
||||
|
||||
AcceptArcTos();
|
||||
}
|
||||
// As we expect the error message to stay on the screen, it is safe to
|
||||
// wait for it in the usual manner.
|
||||
OobeScreenWaiter(DemoSetupScreenView::kScreenId).Wait();
|
||||
@ -774,11 +750,7 @@ IN_PROC_BROWSER_TEST_F(DemoSetupArcSupportedTest, ClickNetworkOnNetworkScreen) {
|
||||
|
||||
ProceedThroughDemoPreferencesScreen();
|
||||
|
||||
if (features::IsOobeConsolidatedConsentEnabled()) {
|
||||
test::WaitForConsolidatedConsentScreen();
|
||||
} else {
|
||||
test::WaitForEulaScreen();
|
||||
}
|
||||
test::WaitForConsolidatedConsentScreen();
|
||||
}
|
||||
|
||||
IN_PROC_BROWSER_TEST_F(DemoSetupArcSupportedTest,
|
||||
@ -797,11 +769,7 @@ IN_PROC_BROWSER_TEST_F(DemoSetupArcSupportedTest,
|
||||
|
||||
ProceedThroughDemoPreferencesScreen();
|
||||
|
||||
if (features::IsOobeConsolidatedConsentEnabled()) {
|
||||
test::WaitForConsolidatedConsentScreen();
|
||||
} else {
|
||||
test::WaitForEulaScreen();
|
||||
}
|
||||
test::WaitForConsolidatedConsentScreen();
|
||||
}
|
||||
|
||||
IN_PROC_BROWSER_TEST_F(DemoSetupArcSupportedTest, BackOnNetworkScreen) {
|
||||
|
@ -1,354 +0,0 @@
|
||||
// Copyright 2013 The Chromium Authors
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include <memory>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "ash/constants/ash_features.h"
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/functional/callback.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/test/bind.h"
|
||||
#include "base/test/metrics/histogram_tester.h"
|
||||
#include "base/test/scoped_feature_list.h"
|
||||
#include "build/build_config.h"
|
||||
#include "chrome/browser/ash/login/test/dialog_window_waiter.h"
|
||||
#include "chrome/browser/ash/login/test/fake_eula_mixin.h"
|
||||
#include "chrome/browser/ash/login/test/js_checker.h"
|
||||
#include "chrome/browser/ash/login/test/oobe_base_test.h"
|
||||
#include "chrome/browser/ash/login/test/oobe_screen_waiter.h"
|
||||
#include "chrome/browser/ash/login/test/scoped_help_app_for_test.h"
|
||||
#include "chrome/browser/ash/login/test/webview_content_extractor.h"
|
||||
#include "chrome/browser/ash/login/ui/login_display_host.h"
|
||||
#include "chrome/browser/ash/login/ui/login_display_host_common.h"
|
||||
#include "chrome/browser/ash/login/wizard_controller.h"
|
||||
#include "chrome/browser/ash/policy/enrollment/enrollment_requisition_manager.h"
|
||||
#include "chrome/browser/ash/settings/stats_reporting_controller.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/profiles/profile_manager.h"
|
||||
#include "chrome/browser/ui/webui/ash/login/eula_screen_handler.h"
|
||||
#include "chrome/browser/ui/webui/ash/login/network_screen_handler.h"
|
||||
#include "chrome/browser/ui/webui/ash/login/oobe_ui.h"
|
||||
#include "chrome/grit/generated_resources.h"
|
||||
#include "chrome/installer/util/google_update_settings.h"
|
||||
#include "chrome/test/base/interactive_test_utils.h"
|
||||
#include "components/guest_view/browser/guest_view_manager.h"
|
||||
#include "components/metrics/metrics_pref_names.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "content/public/browser/web_ui.h"
|
||||
#include "content/public/test/browser_test.h"
|
||||
#include "content/public/test/browser_test_utils.h"
|
||||
#include "testing/gmock/include/gmock/gmock.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "url/gurl.h"
|
||||
|
||||
namespace ash {
|
||||
namespace {
|
||||
|
||||
using ::testing::ElementsAre;
|
||||
|
||||
const test::UIPath kEulaWebview = {"oobe-eula-md", "crosEulaFrame"};
|
||||
const test::UIPath kEulaDialog = {"oobe-eula-md", "eulaDialog"};
|
||||
const test::UIPath kAcceptEulaButton = {"oobe-eula-md", "acceptButton"};
|
||||
const test::UIPath kUsageStats = {"oobe-eula-md", "usageStats"};
|
||||
const test::UIPath kAdditionalTermsLink = {"oobe-eula-md", "additionalTerms"};
|
||||
const test::UIPath kAdditionalTermsDialog = {"oobe-eula-md", "additionalToS"};
|
||||
const test::UIPath kLearnMoreLink = {"oobe-eula-md", "learnMore"};
|
||||
const test::UIPath kBackButton = {"oobe-eula-md", "backButton"};
|
||||
|
||||
const char kRemoraRequisition[] = "remora";
|
||||
|
||||
class EulaTest : public OobeBaseTest {
|
||||
public:
|
||||
EulaTest() {
|
||||
// EULA screen is not shown when OobeConsolidatedConsent is enabled, and
|
||||
// its content is moved to the consolidated consent screen.
|
||||
feature_list_.InitAndDisableFeature(features::kOobeConsolidatedConsent);
|
||||
}
|
||||
|
||||
EulaTest(const EulaTest&) = delete;
|
||||
EulaTest& operator=(const EulaTest&) = delete;
|
||||
|
||||
~EulaTest() override = default;
|
||||
|
||||
void ShowEulaScreen() {
|
||||
LoginDisplayHost::default_host()->StartWizard(EulaView::kScreenId);
|
||||
OobeScreenWaiter(EulaView::kScreenId).Wait();
|
||||
// Wait until the webview has finished loading.
|
||||
test::OobeJS().CreateVisibilityWaiter(true, kEulaDialog)->Wait();
|
||||
}
|
||||
|
||||
protected:
|
||||
void SetUpOnMainThread() override {
|
||||
OobeBaseTest::SetUpOnMainThread();
|
||||
LoginDisplayHost::default_host()->GetWizardContext()->is_branded_build =
|
||||
true;
|
||||
}
|
||||
|
||||
base::OnceClosure SetCollectStatsConsentClosure(bool consented) {
|
||||
return base::BindOnce(
|
||||
base::IgnoreResult(&GoogleUpdateSettings::SetCollectStatsConsent),
|
||||
consented);
|
||||
}
|
||||
|
||||
// Calls `GoogleUpdateSettings::SetCollectStatsConsent` asynchronously on its
|
||||
// task runner. Blocks until task is executed.
|
||||
void SetGoogleCollectStatsConsent(bool consented) {
|
||||
base::RunLoop runloop;
|
||||
GoogleUpdateSettings::CollectStatsConsentTaskRunner()->PostTaskAndReply(
|
||||
FROM_HERE, SetCollectStatsConsentClosure(consented),
|
||||
runloop.QuitClosure());
|
||||
runloop.Run();
|
||||
}
|
||||
|
||||
// Calls `GoogleUpdateSettings::GetCollectStatsConsent` asynchronously on its
|
||||
// task runner. Blocks until task is executed and returns the result.
|
||||
bool GetGoogleCollectStatsConsent() {
|
||||
bool consented = false;
|
||||
|
||||
// Callback runs after GetCollectStatsConsent is executed. Sets the local
|
||||
// variable `consented` to the result of GetCollectStatsConsent.
|
||||
auto on_get_collect_stats_consent_callback =
|
||||
[](base::OnceClosure quit_closure, bool* consented_out,
|
||||
bool consented_result) {
|
||||
*consented_out = consented_result;
|
||||
std::move(quit_closure).Run();
|
||||
};
|
||||
|
||||
base::RunLoop runloop;
|
||||
GoogleUpdateSettings::CollectStatsConsentTaskRunner()
|
||||
->PostTaskAndReplyWithResult(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&GoogleUpdateSettings::GetCollectStatsConsent),
|
||||
base::BindOnce(on_get_collect_stats_consent_callback,
|
||||
runloop.QuitClosure(), &consented));
|
||||
runloop.Run();
|
||||
|
||||
return consented;
|
||||
}
|
||||
|
||||
base::test::ScopedFeatureList feature_list_;
|
||||
FakeEulaMixin fake_eula_{&mixin_host_, embedded_test_server()};
|
||||
};
|
||||
|
||||
// When testing the offline fallback mechanism, the requests reaching the
|
||||
// embedded server have to be handled differently.
|
||||
class EulaOfflineTest : public EulaTest {
|
||||
public:
|
||||
EulaOfflineTest() { fake_eula_.set_force_http_unavailable(true); }
|
||||
|
||||
~EulaOfflineTest() override = default;
|
||||
};
|
||||
|
||||
// Tests that offline version is shown when the online version is not
|
||||
// accessible.
|
||||
IN_PROC_BROWSER_TEST_F(EulaOfflineTest, LoadOffline) {
|
||||
ShowEulaScreen();
|
||||
|
||||
EXPECT_TRUE(test::GetWebViewContents(kEulaWebview)
|
||||
.find(FakeEulaMixin::kOfflineEULAWarning) !=
|
||||
std::string::npos);
|
||||
}
|
||||
|
||||
// Tests that online version is shown when it is accessible.
|
||||
IN_PROC_BROWSER_TEST_F(EulaTest, LoadOnline) {
|
||||
ShowEulaScreen();
|
||||
|
||||
const std::string webview_contents = test::GetWebViewContents(kEulaWebview);
|
||||
EXPECT_TRUE(webview_contents.find(FakeEulaMixin::kFakeOnlineEula) !=
|
||||
std::string::npos);
|
||||
}
|
||||
|
||||
// Verifies statistic collection accepted flow.
|
||||
// Advaces to the next screen and verifies stats collection is enabled.
|
||||
IN_PROC_BROWSER_TEST_F(EulaTest, EnableUsageStats) {
|
||||
base::HistogramTester histogram_tester;
|
||||
ShowEulaScreen();
|
||||
|
||||
// Verify that toggle is enabled by default.
|
||||
test::OobeJS().ExpectAttributeEQ("checked", kUsageStats, true);
|
||||
|
||||
ASSERT_TRUE(StatsReportingController::IsInitialized());
|
||||
|
||||
// Explicitly set as false to make sure test modifies these values.
|
||||
StatsReportingController::Get()->SetEnabled(
|
||||
ProfileManager::GetActiveUserProfile(), false);
|
||||
g_browser_process->local_state()->SetBoolean(
|
||||
metrics::prefs::kMetricsReportingEnabled, false);
|
||||
SetGoogleCollectStatsConsent(false);
|
||||
|
||||
// Start Listening for StatsReportingController updates.
|
||||
base::RunLoop runloop;
|
||||
auto subscription =
|
||||
StatsReportingController::Get()->AddObserver(runloop.QuitClosure());
|
||||
|
||||
// Enable and disable usageStats that to see that metrics are recorded.
|
||||
test::OobeJS().TapOnPath(kUsageStats);
|
||||
test::OobeJS().TapOnPath(kUsageStats);
|
||||
// Advance to the next screen for changes to take effect.
|
||||
test::OobeJS().TapOnPath(kAcceptEulaButton);
|
||||
|
||||
// Wait for StartReporting update.
|
||||
runloop.Run();
|
||||
|
||||
// Verify stats collection is enabled.
|
||||
EXPECT_TRUE(StatsReportingController::Get()->IsEnabled());
|
||||
EXPECT_TRUE(g_browser_process->local_state()->GetBoolean(
|
||||
metrics::prefs::kMetricsReportingEnabled));
|
||||
EXPECT_TRUE(GetGoogleCollectStatsConsent());
|
||||
EXPECT_THAT(
|
||||
histogram_tester.GetAllSamples("OOBE.EulaScreen.UserActions"),
|
||||
ElementsAre(
|
||||
base::Bucket(
|
||||
static_cast<int>(EulaScreen::UserAction::kAcceptButtonClicked),
|
||||
1),
|
||||
base::Bucket(
|
||||
static_cast<int>(EulaScreen::UserAction::kUnselectStatsUsage), 1),
|
||||
base::Bucket(
|
||||
static_cast<int>(EulaScreen::UserAction::kSelectStatsUsage), 1)));
|
||||
}
|
||||
|
||||
// Verify statistic collection denied flow. Clicks on usage stats toggle,
|
||||
// advaces to the next screen and verifies stats collection is disabled.
|
||||
IN_PROC_BROWSER_TEST_F(EulaTest, DisableUsageStats) {
|
||||
base::HistogramTester histogram_tester;
|
||||
ShowEulaScreen();
|
||||
|
||||
// Verify that toggle is enabled by default.
|
||||
test::OobeJS().ExpectAttributeEQ("checked", kUsageStats, true);
|
||||
|
||||
ASSERT_TRUE(StatsReportingController::IsInitialized());
|
||||
|
||||
// Explicitly set as true to make sure test modifies these values.
|
||||
StatsReportingController::Get()->SetEnabled(
|
||||
ProfileManager::GetActiveUserProfile(), true);
|
||||
g_browser_process->local_state()->SetBoolean(
|
||||
metrics::prefs::kMetricsReportingEnabled, true);
|
||||
SetGoogleCollectStatsConsent(true);
|
||||
|
||||
// Start Listening for StatsReportingController updates.
|
||||
base::RunLoop runloop;
|
||||
auto subscription =
|
||||
StatsReportingController::Get()->AddObserver(runloop.QuitClosure());
|
||||
|
||||
// Click on the toggle to disable stats collection and advance to the next
|
||||
// screen for changes to take effect.
|
||||
test::OobeJS().TapOnPath(kUsageStats);
|
||||
test::OobeJS().TapOnPath(kAcceptEulaButton);
|
||||
|
||||
// Wait for StartReportingController update.
|
||||
runloop.Run();
|
||||
|
||||
// Verify stats collection is disabled.
|
||||
EXPECT_FALSE(StatsReportingController::Get()->IsEnabled());
|
||||
EXPECT_FALSE(g_browser_process->local_state()->GetBoolean(
|
||||
metrics::prefs::kMetricsReportingEnabled));
|
||||
EXPECT_FALSE(GetGoogleCollectStatsConsent());
|
||||
EXPECT_THAT(
|
||||
histogram_tester.GetAllSamples("OOBE.EulaScreen.UserActions"),
|
||||
ElementsAre(
|
||||
base::Bucket(
|
||||
static_cast<int>(EulaScreen::UserAction::kAcceptButtonClicked),
|
||||
1),
|
||||
base::Bucket(
|
||||
static_cast<int>(EulaScreen::UserAction::kUnselectStatsUsage),
|
||||
1)));
|
||||
}
|
||||
|
||||
// Tests that clicking on "Learn more" button opens a help dialog.
|
||||
IN_PROC_BROWSER_TEST_F(EulaTest, LearnMore) {
|
||||
base::HistogramTester histogram_tester;
|
||||
ShowEulaScreen();
|
||||
|
||||
// Load HelperApp extension.
|
||||
ScopedHelpAppForTest scoped_help_app;
|
||||
|
||||
// Start listening for help dialog creation.
|
||||
DialogWindowWaiter waiter(
|
||||
l10n_util::GetStringUTF16(IDS_LOGIN_OOBE_HELP_DIALOG_TITLE));
|
||||
|
||||
test::OobeJS().TapLinkOnPath(kLearnMoreLink);
|
||||
|
||||
// Wait until help dialog is displayed.
|
||||
waiter.Wait();
|
||||
EXPECT_THAT(
|
||||
histogram_tester.GetAllSamples("OOBE.EulaScreen.UserActions"),
|
||||
ElementsAre(base::Bucket(
|
||||
static_cast<int>(EulaScreen::UserAction::kShowStatsUsageLearnMore),
|
||||
1)));
|
||||
}
|
||||
|
||||
#if defined(NDEBUG)
|
||||
#define MAYBE_AdditionalToS DISABLED_AdditionalToS
|
||||
#else
|
||||
#define MAYBE_AdditionalToS AdditionalToS
|
||||
#endif
|
||||
// Tests that "Additional ToS" dialog could be opened and closed.
|
||||
IN_PROC_BROWSER_TEST_F(EulaTest, MAYBE_AdditionalToS) {
|
||||
base::HistogramTester histogram_tester;
|
||||
ShowEulaScreen();
|
||||
|
||||
test::OobeJS().TapLinkOnPath(kAdditionalTermsLink);
|
||||
|
||||
test::OobeJS()
|
||||
.CreateWaiter(test::GetOobeElementPath(kAdditionalTermsDialog) + ".open")
|
||||
->Wait();
|
||||
|
||||
ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync(
|
||||
nullptr, ui::VKEY_RETURN, false /* control */, false /* shift */,
|
||||
false /* alt */, false /* command */));
|
||||
|
||||
test::OobeJS()
|
||||
.CreateWaiter(test::GetOobeElementPath(kAdditionalTermsDialog) +
|
||||
".open === false")
|
||||
->Wait();
|
||||
test::OobeJS().ExpectFocused(kAdditionalTermsLink);
|
||||
|
||||
EXPECT_THAT(
|
||||
histogram_tester.GetAllSamples("OOBE.EulaScreen.UserActions"),
|
||||
ElementsAre(base::Bucket(
|
||||
static_cast<int>(EulaScreen::UserAction::kShowAdditionalTos), 1)));
|
||||
}
|
||||
|
||||
// Skipped EULA for Remora Requisition.
|
||||
IN_PROC_BROWSER_TEST_F(EulaTest, SkippedEula) {
|
||||
ASSERT_TRUE(StatsReportingController::IsInitialized());
|
||||
|
||||
// Explicitly set as true to make sure test modifies these values.
|
||||
StatsReportingController::Get()->SetEnabled(
|
||||
ProfileManager::GetActiveUserProfile(), true);
|
||||
g_browser_process->local_state()->SetBoolean(
|
||||
metrics::prefs::kMetricsReportingEnabled, true);
|
||||
SetGoogleCollectStatsConsent(true);
|
||||
|
||||
// Start Listening for StatsReportingController updates.
|
||||
base::RunLoop runloop;
|
||||
auto subscription =
|
||||
StatsReportingController::Get()->AddObserver(runloop.QuitClosure());
|
||||
|
||||
policy::EnrollmentRequisitionManager::SetDeviceRequisition(
|
||||
kRemoraRequisition);
|
||||
LoginDisplayHost::default_host()->StartWizard(EulaView::kScreenId);
|
||||
|
||||
// Wait for StartReportingController update.
|
||||
runloop.Run();
|
||||
|
||||
// Verify stats collection is disabled.
|
||||
EXPECT_FALSE(StatsReportingController::Get()->IsEnabled());
|
||||
EXPECT_FALSE(g_browser_process->local_state()->GetBoolean(
|
||||
metrics::prefs::kMetricsReportingEnabled));
|
||||
EXPECT_FALSE(GetGoogleCollectStatsConsent());
|
||||
}
|
||||
|
||||
IN_PROC_BROWSER_TEST_F(EulaTest, ClickBack) {
|
||||
ShowEulaScreen();
|
||||
test::OobeJS().ClickOnPath(kBackButton);
|
||||
OobeScreenWaiter(NetworkScreenView::kScreenId).Wait();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace ash
|
@ -2,9 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "ash/constants/ash_features.h"
|
||||
#include "ash/constants/ash_switches.h"
|
||||
#include "base/test/scoped_feature_list.h"
|
||||
#include "chrome/browser/ash/login/existing_user_controller.h"
|
||||
#include "chrome/browser/ash/login/login_manager_test.h"
|
||||
#include "chrome/browser/ash/login/login_pref_names.h"
|
||||
@ -23,7 +21,6 @@
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/profiles/profile_manager.h"
|
||||
#include "chrome/browser/ui/webui/ash/login/consolidated_consent_screen_handler.h"
|
||||
#include "chrome/browser/ui/webui/ash/login/eula_screen_handler.h"
|
||||
#include "chrome/browser/ui/webui/ash/login/hardware_data_collection_screen_handler.h"
|
||||
#include "content/public/test/browser_test.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
@ -32,8 +29,6 @@ namespace ash {
|
||||
|
||||
namespace {
|
||||
|
||||
const test::UIPath kEulaDialog = {"oobe-eula-md", "eulaDialog"};
|
||||
const test::UIPath kAcceptEulaButton = {"oobe-eula-md", "acceptButton"};
|
||||
const test::UIPath kAcceptHWDataCollectionButton = {"hw-data-collection",
|
||||
"acceptButton"};
|
||||
const test::UIPath kAcceptConsolidatedConsentButton = {"consolidated-consent",
|
||||
@ -43,21 +38,10 @@ const test::UIPath kConsolidatedConsentDialog = {"consolidated-consent",
|
||||
|
||||
} // namespace
|
||||
|
||||
// Boolean parameter represents OobeConsolidatedConsent feature state.
|
||||
class LoginAfterUpdateToFlexTest : public LoginManagerTest,
|
||||
public LocalStateMixin::Delegate,
|
||||
public ::testing::WithParamInterface<bool> {
|
||||
public LocalStateMixin::Delegate {
|
||||
public:
|
||||
LoginAfterUpdateToFlexTest() {
|
||||
if (GetParam()) {
|
||||
scoped_feature_list_.InitAndEnableFeature(
|
||||
features::kOobeConsolidatedConsent);
|
||||
} else {
|
||||
scoped_feature_list_.InitAndDisableFeature(
|
||||
features::kOobeConsolidatedConsent);
|
||||
}
|
||||
login_manager_mixin_.AppendRegularUsers(2);
|
||||
}
|
||||
LoginAfterUpdateToFlexTest() { login_manager_mixin_.AppendRegularUsers(2); }
|
||||
|
||||
LoginAfterUpdateToFlexTest(const LoginAfterUpdateToFlexTest&) = delete;
|
||||
LoginAfterUpdateToFlexTest& operator=(const LoginAfterUpdateToFlexTest&) =
|
||||
@ -105,49 +89,38 @@ class LoginAfterUpdateToFlexTest : public LoginManagerTest,
|
||||
FakeEulaMixin fake_eula_{&mixin_host_, embedded_test_server()};
|
||||
ScopedCrosSettingsTestHelper settings_helper_{
|
||||
/*create_settings_service=*/false};
|
||||
base::test::ScopedFeatureList scoped_feature_list_;
|
||||
LocalStateMixin local_state_mixin_{&mixin_host_, this};
|
||||
};
|
||||
|
||||
IN_PROC_BROWSER_TEST_P(LoginAfterUpdateToFlexTest, DeviceOwner) {
|
||||
IN_PROC_BROWSER_TEST_F(LoginAfterUpdateToFlexTest, DeviceOwner) {
|
||||
LoginUser(GetOwnerAccountId());
|
||||
if (!features::IsOobeConsolidatedConsentEnabled()) {
|
||||
OobeScreenWaiter(EulaView::kScreenId).Wait();
|
||||
// Wait until the webview has finished loading.
|
||||
test::OobeJS().CreateVisibilityWaiter(true, kEulaDialog)->Wait();
|
||||
test::OobeJS().TapOnPath(kAcceptEulaButton);
|
||||
} else {
|
||||
EXPECT_FALSE(ProfileManager::GetActiveUserProfile()->GetPrefs()->GetBoolean(
|
||||
prefs::kRevenOobeConsolidatedConsentAccepted));
|
||||
OobeScreenWaiter(ConsolidatedConsentScreenView::kScreenId).Wait();
|
||||
test::OobeJS()
|
||||
.CreateVisibilityWaiter(true, kConsolidatedConsentDialog)
|
||||
->Wait();
|
||||
test::OobeJS().TapOnPath(kAcceptConsolidatedConsentButton);
|
||||
EXPECT_TRUE(ProfileManager::GetActiveUserProfile()->GetPrefs()->GetBoolean(
|
||||
prefs::kRevenOobeConsolidatedConsentAccepted));
|
||||
}
|
||||
EXPECT_FALSE(ProfileManager::GetActiveUserProfile()->GetPrefs()->GetBoolean(
|
||||
prefs::kRevenOobeConsolidatedConsentAccepted));
|
||||
OobeScreenWaiter(ConsolidatedConsentScreenView::kScreenId).Wait();
|
||||
test::OobeJS()
|
||||
.CreateVisibilityWaiter(true, kConsolidatedConsentDialog)
|
||||
->Wait();
|
||||
test::OobeJS().TapOnPath(kAcceptConsolidatedConsentButton);
|
||||
EXPECT_TRUE(ProfileManager::GetActiveUserProfile()->GetPrefs()->GetBoolean(
|
||||
prefs::kRevenOobeConsolidatedConsentAccepted));
|
||||
|
||||
OobeScreenWaiter(HWDataCollectionView::kScreenId).Wait();
|
||||
test::OobeJS().TapOnPath(kAcceptHWDataCollectionButton);
|
||||
test::WaitForPrimaryUserSessionStart();
|
||||
}
|
||||
|
||||
IN_PROC_BROWSER_TEST_P(LoginAfterUpdateToFlexTest, RegularUser) {
|
||||
IN_PROC_BROWSER_TEST_F(LoginAfterUpdateToFlexTest, RegularUser) {
|
||||
LoginUser(GetRegularAccountId());
|
||||
if (features::IsOobeConsolidatedConsentEnabled()) {
|
||||
EXPECT_FALSE(ProfileManager::GetActiveUserProfile()->GetPrefs()->GetBoolean(
|
||||
prefs::kRevenOobeConsolidatedConsentAccepted));
|
||||
OobeScreenWaiter(ConsolidatedConsentScreenView::kScreenId).Wait();
|
||||
test::OobeJS()
|
||||
.CreateVisibilityWaiter(true, kConsolidatedConsentDialog)
|
||||
->Wait();
|
||||
test::OobeJS().TapOnPath(kAcceptConsolidatedConsentButton);
|
||||
EXPECT_TRUE(ProfileManager::GetActiveUserProfile()->GetPrefs()->GetBoolean(
|
||||
prefs::kRevenOobeConsolidatedConsentAccepted));
|
||||
}
|
||||
EXPECT_FALSE(ProfileManager::GetActiveUserProfile()->GetPrefs()->GetBoolean(
|
||||
prefs::kRevenOobeConsolidatedConsentAccepted));
|
||||
OobeScreenWaiter(ConsolidatedConsentScreenView::kScreenId).Wait();
|
||||
test::OobeJS()
|
||||
.CreateVisibilityWaiter(true, kConsolidatedConsentDialog)
|
||||
->Wait();
|
||||
test::OobeJS().TapOnPath(kAcceptConsolidatedConsentButton);
|
||||
EXPECT_TRUE(ProfileManager::GetActiveUserProfile()->GetPrefs()->GetBoolean(
|
||||
prefs::kRevenOobeConsolidatedConsentAccepted));
|
||||
test::WaitForPrimaryUserSessionStart();
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(All, LoginAfterUpdateToFlexTest, testing::Bool());
|
||||
|
||||
} // namespace ash
|
||||
|
@ -136,20 +136,6 @@ void RunNetworkSelectionScreenChecks() {
|
||||
EXPECT_TRUE(test::IsScanningRequestedOnNetworkScreen());
|
||||
}
|
||||
|
||||
void RunEulaScreenChecks() {
|
||||
// Wait for actual EULA to appear.
|
||||
test::OobeJS()
|
||||
.CreateVisibilityWaiter(true, {"oobe-eula-md", "eulaDialog"})
|
||||
->Wait();
|
||||
test::OobeJS().ExpectEnabledPath({"oobe-eula-md", "acceptButton"});
|
||||
test::OobeJS().CreateFocusWaiter({"oobe-eula-md", "acceptButton"})->Wait();
|
||||
|
||||
EXPECT_FALSE(LoginScreenTestApi::IsShutdownButtonShown());
|
||||
EXPECT_FALSE(LoginScreenTestApi::IsGuestButtonShown());
|
||||
EXPECT_FALSE(LoginScreenTestApi::IsAddUserButtonShown());
|
||||
EXPECT_FALSE(test::IsScanningRequestedOnNetworkScreen());
|
||||
}
|
||||
|
||||
void WaitForGaiaSignInScreen(bool wait_for_arc_preloading) {
|
||||
OobeScreenWaiter(GaiaView::kScreenId).Wait();
|
||||
test::OobeJS()
|
||||
@ -704,12 +690,6 @@ void OobeInteractiveUITest::PerformStepsBeforeEnrollmentCheck() {
|
||||
RunNetworkSelectionScreenChecks();
|
||||
test::TapNetworkSelectionNext();
|
||||
|
||||
if (!features::IsOobeConsolidatedConsentEnabled()) {
|
||||
test::WaitForEulaScreen();
|
||||
RunEulaScreenChecks();
|
||||
test::TapEulaAccept();
|
||||
}
|
||||
|
||||
test::WaitForUpdateScreen();
|
||||
test::ExitUpdateScreenNoUpdate();
|
||||
}
|
||||
|
@ -1,26 +0,0 @@
|
||||
// Copyright 2011 The Chromium Authors
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "chrome/browser/ash/login/screens/mock_eula_screen.h"
|
||||
|
||||
namespace ash {
|
||||
|
||||
using ::testing::AtLeast;
|
||||
using ::testing::_;
|
||||
|
||||
MockEulaScreen::MockEulaScreen(base::WeakPtr<EulaView> view,
|
||||
const ScreenExitCallback& exit_callback)
|
||||
: EulaScreen(std::move(view), exit_callback) {}
|
||||
|
||||
MockEulaScreen::~MockEulaScreen() {}
|
||||
|
||||
void MockEulaScreen::ExitScreen(Result result) {
|
||||
exit_callback()->Run(result);
|
||||
}
|
||||
|
||||
MockEulaView::MockEulaView() = default;
|
||||
|
||||
MockEulaView::~MockEulaView() = default;
|
||||
|
||||
} // namespace ash
|
@ -1,42 +0,0 @@
|
||||
// Copyright 2012 The Chromium Authors
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef CHROME_BROWSER_ASH_LOGIN_SCREENS_MOCK_EULA_SCREEN_H_
|
||||
#define CHROME_BROWSER_ASH_LOGIN_SCREENS_MOCK_EULA_SCREEN_H_
|
||||
|
||||
#include "chrome/browser/ash/login/screens/eula_screen.h"
|
||||
#include "chrome/browser/ui/webui/ash/login/eula_screen_handler.h"
|
||||
#include "testing/gmock/include/gmock/gmock.h"
|
||||
|
||||
namespace ash {
|
||||
|
||||
class MockEulaScreen : public EulaScreen {
|
||||
public:
|
||||
MockEulaScreen(base::WeakPtr<EulaView> view,
|
||||
const ScreenExitCallback& exit_callback);
|
||||
~MockEulaScreen() override;
|
||||
|
||||
MOCK_METHOD(void, ShowImpl, ());
|
||||
MOCK_METHOD(void, HideImpl, ());
|
||||
|
||||
void ExitScreen(Result result);
|
||||
};
|
||||
|
||||
class MockEulaView : public EulaView {
|
||||
public:
|
||||
MockEulaView();
|
||||
~MockEulaView() override;
|
||||
|
||||
MOCK_METHOD(void, Show, (const bool is_cloud_ready_update_flow), (override));
|
||||
MOCK_METHOD(void, Hide, (), (override));
|
||||
|
||||
MOCK_METHOD(void, SetUsageStatsEnabled, (bool enabled), (override));
|
||||
MOCK_METHOD(void, ShowStatsUsageLearnMore, (), (override));
|
||||
MOCK_METHOD(void, ShowAdditionalTosDialog, (), (override));
|
||||
MOCK_METHOD(void, ShowSecuritySettingsDialog, (), (override));
|
||||
};
|
||||
|
||||
} // namespace ash
|
||||
|
||||
#endif // CHROME_BROWSER_ASH_LOGIN_SCREENS_MOCK_EULA_SCREEN_H_
|
@ -6,7 +6,6 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "ash/constants/ash_features.h"
|
||||
#include "ash/constants/ash_switches.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/functional/bind.h"
|
||||
@ -26,7 +25,6 @@
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/browser_process_platform_part.h"
|
||||
#include "chrome/browser/lifetime/application_lifetime.h"
|
||||
#include "chrome/browser/ui/webui/ash/login/eula_screen_handler.h"
|
||||
#include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h"
|
||||
#include "chrome/browser/ui/webui/ash/login/oobe_ui.h"
|
||||
#include "chrome/browser/ui/webui/ash/login/update_screen_handler.h"
|
||||
@ -223,12 +221,6 @@ OobeScreenId OobeBaseTest::GetFirstSigninScreen() {
|
||||
: GaiaView::kScreenId;
|
||||
}
|
||||
|
||||
// static
|
||||
OobeScreenId OobeBaseTest::GetScreenAfterNetworkScreen() {
|
||||
bool consolidated_enabled = features::IsOobeConsolidatedConsentEnabled();
|
||||
return consolidated_enabled ? UpdateView::kScreenId : EulaView::kScreenId;
|
||||
}
|
||||
|
||||
void OobeBaseTest::MaybeWaitForLoginScreenLoad() {
|
||||
if (!login_screen_load_observer_)
|
||||
return;
|
||||
|
@ -37,7 +37,6 @@ class OobeBaseTest : public MixinBasedInProcessBrowserTest {
|
||||
virtual void RegisterAdditionalRequestHandlers();
|
||||
|
||||
static OobeScreenId GetFirstSigninScreen();
|
||||
static OobeScreenId GetScreenAfterNetworkScreen();
|
||||
|
||||
protected:
|
||||
// MixinBasedInProcessBrowserTest::
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/ui/webui/ash/login/consolidated_consent_screen_handler.h"
|
||||
#include "chrome/browser/ui/webui/ash/login/enrollment_screen_handler.h"
|
||||
#include "chrome/browser/ui/webui/ash/login/eula_screen_handler.h"
|
||||
#include "chrome/browser/ui/webui/ash/login/fingerprint_setup_screen_handler.h"
|
||||
#include "chrome/browser/ui/webui/ash/login/guest_tos_screen_handler.h"
|
||||
#include "chrome/browser/ui/webui/ash/login/marketing_opt_in_screen_handler.h"
|
||||
@ -125,11 +124,6 @@ void SkipToEnrollmentOnRecovery() {
|
||||
WaitForNetworkSelectionScreen();
|
||||
TapNetworkSelectionNext();
|
||||
|
||||
if (!features::IsOobeConsolidatedConsentEnabled()) {
|
||||
WaitForEulaScreen();
|
||||
TapEulaAccept();
|
||||
}
|
||||
|
||||
WaitForUpdateScreen();
|
||||
ExitUpdateScreenNoUpdate();
|
||||
|
||||
@ -163,18 +157,6 @@ void WaitForOobeJSReady() {
|
||||
}
|
||||
}
|
||||
|
||||
void WaitForEulaScreen() {
|
||||
if (!LoginDisplayHost::default_host()->GetWizardContext()->is_branded_build)
|
||||
return;
|
||||
WaitFor(EulaView::kScreenId);
|
||||
}
|
||||
|
||||
void TapEulaAccept() {
|
||||
if (!LoginDisplayHost::default_host()->GetWizardContext()->is_branded_build)
|
||||
return;
|
||||
OobeJS().TapOnPath({"oobe-eula-md", "acceptButton"});
|
||||
}
|
||||
|
||||
void WaitForSyncConsentScreen() {
|
||||
if (!LoginDisplayHost::default_host()->GetWizardContext()->is_branded_build)
|
||||
return;
|
||||
|
@ -30,8 +30,6 @@ void TapUserCreationNext();
|
||||
// Wait for OobeUI to finish loading.
|
||||
void WaitForOobeJSReady();
|
||||
|
||||
void WaitForEulaScreen();
|
||||
void TapEulaAccept();
|
||||
void WaitForSyncConsentScreen();
|
||||
void ExitScreenSyncConsent();
|
||||
void WaitForConsolidatedConsentScreen();
|
||||
|
@ -66,7 +66,6 @@
|
||||
#include "chrome/browser/ui/browser.h"
|
||||
#include "chrome/browser/ui/login/login_handler.h"
|
||||
#include "chrome/browser/ui/webui/ash/login/error_screen_handler.h"
|
||||
#include "chrome/browser/ui/webui/ash/login/eula_screen_handler.h"
|
||||
#include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h"
|
||||
#include "chrome/browser/ui/webui/ash/login/marketing_opt_in_screen_handler.h"
|
||||
#include "chrome/browser/ui/webui/ash/login/user_creation_screen_handler.h"
|
||||
@ -1273,11 +1272,6 @@ class WebviewClientCertsLoginTestBase : public WebviewLoginTest {
|
||||
return server_ssl_info;
|
||||
}
|
||||
|
||||
void ShowEulaScreen() {
|
||||
LoginDisplayHost::default_host()->StartWizard(EulaView::kScreenId);
|
||||
OobeScreenWaiter(EulaView::kScreenId).Wait();
|
||||
}
|
||||
|
||||
protected:
|
||||
void SetUpInProcessBrowserTestFixture() override {
|
||||
// Override FakeSessionManagerClient. This will be shut down by the browser.
|
||||
@ -1388,8 +1382,6 @@ IN_PROC_BROWSER_TEST_F(WebviewClientCertsLoginTest,
|
||||
R"({"pattern": "*", "filter": {"ISSUER": {"CN": "B CA"}}})"};
|
||||
SetAutoSelectCertificatePatterns(autoselect_patterns);
|
||||
|
||||
ShowEulaScreen();
|
||||
|
||||
// Use `watch_new_webcontents` because the EULA webview has not navigated yet.
|
||||
absl::optional<net::SSLInfo> ssl_info =
|
||||
RequestClientCertTestPageInFrame(test::OobeJS(), "$('cros-eula-frame')");
|
||||
|
@ -43,7 +43,6 @@
|
||||
#include "chrome/browser/ash/login/screens/mock_device_disabled_screen_view.h"
|
||||
#include "chrome/browser/ash/login/screens/mock_enable_adb_sideloading_screen.h"
|
||||
#include "chrome/browser/ash/login/screens/mock_enable_debugging_screen.h"
|
||||
#include "chrome/browser/ash/login/screens/mock_eula_screen.h"
|
||||
#include "chrome/browser/ash/login/screens/mock_network_screen.h"
|
||||
#include "chrome/browser/ash/login/screens/mock_update_screen.h"
|
||||
#include "chrome/browser/ash/login/screens/mock_welcome_screen.h"
|
||||
@ -574,13 +573,6 @@ class WizardControllerFlowTest : public WizardControllerTest {
|
||||
base::BindRepeating(&WizardController::OnUpdateScreenExit,
|
||||
base::Unretained(wizard_controller))));
|
||||
|
||||
mock_eula_view_ = std::make_unique<MockEulaView>();
|
||||
mock_eula_screen_ =
|
||||
MockScreenExpectLifecycle(std::make_unique<MockEulaScreen>(
|
||||
mock_eula_view_.get()->AsWeakPtr(),
|
||||
base::BindRepeating(&WizardController::OnEulaScreenExit,
|
||||
base::Unretained(wizard_controller))));
|
||||
|
||||
mock_enrollment_screen_view_ = std::make_unique<MockEnrollmentScreenView>();
|
||||
mock_enrollment_screen_ =
|
||||
MockScreenExpectLifecycle(std::make_unique<MockEnrollmentScreen>(
|
||||
@ -736,21 +728,7 @@ class WizardControllerFlowTest : public WizardControllerTest {
|
||||
InitNetworkPortalDetector();
|
||||
|
||||
EXPECT_CALL(*mock_update_screen_, ShowImpl()).Times(1);
|
||||
if (features::IsOobeConsolidatedConsentEnabled()) {
|
||||
// EULA screen is skipped when OobeConsolidatedConsent is enabled.
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
} else {
|
||||
EXPECT_CALL(*mock_eula_screen_, ShowImpl()).Times(1);
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
CheckCurrentScreen(EulaView::kScreenId);
|
||||
// Login shelf should still be visible.
|
||||
EXPECT_TRUE(LoginScreenTestApi::IsLoginShelfShown());
|
||||
|
||||
EXPECT_CALL(*mock_eula_screen_, HideImpl()).Times(1);
|
||||
mock_eula_screen_->ExitScreen(
|
||||
EulaScreen::Result::ACCEPTED_WITHOUT_USAGE_STATS_REPORTING);
|
||||
}
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
EXPECT_TRUE(GetGeolocationProvider());
|
||||
|
||||
@ -764,7 +742,6 @@ class WizardControllerFlowTest : public WizardControllerTest {
|
||||
|
||||
CheckCurrentScreen(UserCreationView::kScreenId);
|
||||
EXPECT_CALL(*mock_auto_enrollment_check_screen_, HideImpl()).Times(0);
|
||||
EXPECT_CALL(*mock_eula_screen_, ShowImpl()).Times(0);
|
||||
|
||||
EXPECT_FALSE(ExistingUserController::current_controller() == nullptr);
|
||||
|
||||
@ -785,9 +762,6 @@ class WizardControllerFlowTest : public WizardControllerTest {
|
||||
MockUpdateScreen* mock_update_screen_ = nullptr;
|
||||
std::unique_ptr<MockUpdateView> mock_update_view_;
|
||||
|
||||
MockEulaScreen* mock_eula_screen_ = nullptr;
|
||||
std::unique_ptr<MockEulaView> mock_eula_view_;
|
||||
|
||||
MockEnrollmentScreen* mock_enrollment_screen_ = nullptr;
|
||||
std::unique_ptr<MockEnrollmentScreenView> mock_enrollment_screen_view_;
|
||||
|
||||
@ -848,18 +822,7 @@ IN_PROC_BROWSER_TEST_F(WizardControllerFlowTest,
|
||||
EXPECT_CALL(*mock_network_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_update_screen_, ShowImpl()).Times(1);
|
||||
|
||||
if (features::IsOobeConsolidatedConsentEnabled()) {
|
||||
// EULA screen is skipped when OobeConsolidatedConsent is enabled.
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
} else {
|
||||
EXPECT_CALL(*mock_eula_screen_, ShowImpl()).Times(1);
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
CheckCurrentScreen(EulaView::kScreenId);
|
||||
EXPECT_CALL(*mock_eula_screen_, HideImpl()).Times(1);
|
||||
mock_eula_screen_->ExitScreen(
|
||||
EulaScreen::Result::ACCEPTED_WITHOUT_USAGE_STATS_REPORTING);
|
||||
}
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
// Let update screen smooth time process (time = 0ms).
|
||||
content::RunAllPendingInMessageLoop();
|
||||
@ -871,7 +834,6 @@ IN_PROC_BROWSER_TEST_F(WizardControllerFlowTest,
|
||||
|
||||
CheckCurrentScreen(UserCreationView::kScreenId);
|
||||
EXPECT_CALL(*mock_auto_enrollment_check_screen_, HideImpl()).Times(0);
|
||||
EXPECT_CALL(*mock_eula_screen_, ShowImpl()).Times(0);
|
||||
|
||||
EXPECT_FALSE(ExistingUserController::current_controller() == nullptr);
|
||||
}
|
||||
@ -891,25 +853,13 @@ IN_PROC_BROWSER_TEST_F(WizardControllerFlowTest,
|
||||
EXPECT_CALL(*mock_network_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_update_screen_, ShowImpl()).Times(1);
|
||||
|
||||
if (features::IsOobeConsolidatedConsentEnabled()) {
|
||||
// EULA screen is skipped when OobeConsolidatedConsent is enabled.
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
} else {
|
||||
EXPECT_CALL(*mock_eula_screen_, ShowImpl()).Times(1);
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
CheckCurrentScreen(EulaView::kScreenId);
|
||||
EXPECT_CALL(*mock_eula_screen_, HideImpl()).Times(1);
|
||||
mock_eula_screen_->ExitScreen(
|
||||
EulaScreen::Result::ACCEPTED_WITHOUT_USAGE_STATS_REPORTING);
|
||||
}
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
// Let update screen smooth time process (time = 0ms).
|
||||
content::RunAllPendingInMessageLoop();
|
||||
|
||||
CheckCurrentScreen(UpdateView::kScreenId);
|
||||
EXPECT_CALL(*mock_update_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_eula_screen_, ShowImpl()).Times(0);
|
||||
EXPECT_CALL(*mock_auto_enrollment_check_screen_, ShowImpl()).Times(0);
|
||||
EXPECT_CALL(*mock_network_screen_, ShowImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_network_screen_, HideImpl()).Times(0); // last transition
|
||||
@ -931,34 +881,15 @@ IN_PROC_BROWSER_TEST_F(WizardControllerFlowTest, ControlFlowSkipUpdateEnroll) {
|
||||
CheckCurrentScreen(NetworkScreenView::kScreenId);
|
||||
EXPECT_CALL(*mock_update_screen_, ShowImpl()).Times(0);
|
||||
|
||||
if (features::IsOobeConsolidatedConsentEnabled()) {
|
||||
// EULA screen is skipped when OobeConsolidatedConsent is enabled.
|
||||
WizardController::default_controller()
|
||||
->wizard_context_->enrollment_triggered_early = true;
|
||||
EXPECT_CALL(*mock_enrollment_screen_view_,
|
||||
SetEnrollmentConfig(EnrollmentModeMatches(
|
||||
policy::EnrollmentConfig::MODE_MANUAL)))
|
||||
.Times(1);
|
||||
EXPECT_CALL(*mock_auto_enrollment_check_screen_, ShowImpl()).Times(0);
|
||||
EXPECT_CALL(*mock_enrollment_screen_, ShowImpl()).Times(1);
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
} else {
|
||||
EXPECT_CALL(*mock_eula_screen_, ShowImpl()).Times(1);
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
CheckCurrentScreen(EulaView::kScreenId);
|
||||
EXPECT_CALL(*mock_eula_screen_, HideImpl()).Times(1);
|
||||
WizardController::default_controller()
|
||||
->wizard_context_->enrollment_triggered_early = true;
|
||||
EXPECT_CALL(*mock_enrollment_screen_view_,
|
||||
SetEnrollmentConfig(EnrollmentModeMatches(
|
||||
policy::EnrollmentConfig::MODE_MANUAL)))
|
||||
.Times(1);
|
||||
EXPECT_CALL(*mock_auto_enrollment_check_screen_, ShowImpl()).Times(0);
|
||||
EXPECT_CALL(*mock_enrollment_screen_, ShowImpl()).Times(1);
|
||||
mock_eula_screen_->ExitScreen(
|
||||
EulaScreen::Result::ACCEPTED_WITHOUT_USAGE_STATS_REPORTING);
|
||||
}
|
||||
WizardController::default_controller()
|
||||
->wizard_context_->enrollment_triggered_early = true;
|
||||
EXPECT_CALL(*mock_enrollment_screen_view_,
|
||||
SetEnrollmentConfig(
|
||||
EnrollmentModeMatches(policy::EnrollmentConfig::MODE_MANUAL)))
|
||||
.Times(1);
|
||||
EXPECT_CALL(*mock_auto_enrollment_check_screen_, ShowImpl()).Times(0);
|
||||
EXPECT_CALL(*mock_enrollment_screen_, ShowImpl()).Times(1);
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
content::RunAllPendingInMessageLoop();
|
||||
|
||||
@ -968,31 +899,6 @@ IN_PROC_BROWSER_TEST_F(WizardControllerFlowTest, ControlFlowSkipUpdateEnroll) {
|
||||
content::RunAllPendingInMessageLoop();
|
||||
}
|
||||
|
||||
IN_PROC_BROWSER_TEST_F(WizardControllerFlowTest, ControlFlowEulaDeclined) {
|
||||
// EULA screen will be skipped if the OobeConsolidatedConsent is enabled.
|
||||
if (features::IsOobeConsolidatedConsentEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
CheckCurrentScreen(WelcomeView::kScreenId);
|
||||
EXPECT_CALL(*mock_network_screen_, ShowImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_welcome_screen_, HideImpl()).Times(1);
|
||||
mock_welcome_screen_->ExitScreen(WelcomeScreen::Result::NEXT);
|
||||
|
||||
CheckCurrentScreen(NetworkScreenView::kScreenId);
|
||||
EXPECT_CALL(*mock_eula_screen_, ShowImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_network_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_update_screen_, ShowImpl()).Times(0);
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
CheckCurrentScreen(EulaView::kScreenId);
|
||||
EXPECT_CALL(*mock_network_screen_, ShowImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_eula_screen_, HideImpl()).Times(1);
|
||||
mock_eula_screen_->ExitScreen(EulaScreen::Result::BACK);
|
||||
|
||||
CheckCurrentScreen(NetworkScreenView::kScreenId);
|
||||
}
|
||||
|
||||
IN_PROC_BROWSER_TEST_F(WizardControllerFlowTest,
|
||||
ControlFlowEnrollmentCompleted) {
|
||||
CheckCurrentScreen(WelcomeView::kScreenId);
|
||||
@ -1090,20 +996,7 @@ IN_PROC_BROWSER_TEST_P(WizardControllerUpdateAfterCompletedOobeTest,
|
||||
EXPECT_CALL(*mock_network_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_update_screen_, ShowImpl()).Times(1);
|
||||
|
||||
if (features::IsOobeConsolidatedConsentEnabled()) {
|
||||
// EULA screen is skipped when OobeConsolidatedConsent is enabled.
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
} else {
|
||||
EXPECT_CALL(*mock_eula_screen_, ShowImpl()).Times(1);
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
CheckCurrentScreen(EulaView::kScreenId);
|
||||
|
||||
testing::Mock::VerifyAndClearExpectations(mock_eula_screen_);
|
||||
EXPECT_CALL(*mock_eula_screen_, HideImpl()).Times(1);
|
||||
mock_eula_screen_->ExitScreen(
|
||||
EulaScreen::Result::ACCEPTED_WITHOUT_USAGE_STATS_REPORTING);
|
||||
}
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
// Let update screen smooth time process (time = 0ms).
|
||||
content::RunAllPendingInMessageLoop();
|
||||
@ -1118,9 +1011,7 @@ IN_PROC_BROWSER_TEST_P(WizardControllerUpdateAfterCompletedOobeTest,
|
||||
CheckCurrentScreen(UserCreationView::kScreenId);
|
||||
|
||||
testing::Mock::VerifyAndClearExpectations(mock_auto_enrollment_check_screen_);
|
||||
testing::Mock::VerifyAndClearExpectations(mock_eula_screen_);
|
||||
EXPECT_CALL(*mock_auto_enrollment_check_screen_, HideImpl()).Times(0);
|
||||
EXPECT_CALL(*mock_eula_screen_, ShowImpl()).Times(0);
|
||||
|
||||
EXPECT_NE(nullptr, ExistingUserController::current_controller());
|
||||
}
|
||||
@ -1214,18 +1105,7 @@ IN_PROC_BROWSER_TEST_F(WizardControllerDeviceStateTest,
|
||||
EXPECT_CALL(*mock_network_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_update_screen_, ShowImpl()).Times(1);
|
||||
|
||||
if (features::IsOobeConsolidatedConsentEnabled()) {
|
||||
// EULA screen is skipped when OobeConsolidatedConsent is enabled.
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
} else {
|
||||
EXPECT_CALL(*mock_eula_screen_, ShowImpl()).Times(1);
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
CheckCurrentScreen(EulaView::kScreenId);
|
||||
EXPECT_CALL(*mock_eula_screen_, HideImpl()).Times(1);
|
||||
mock_eula_screen_->ExitScreen(
|
||||
EulaScreen::Result::ACCEPTED_WITHOUT_USAGE_STATS_REPORTING);
|
||||
}
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
// Let update screen smooth time process (time = 0ms).
|
||||
content::RunAllPendingInMessageLoop();
|
||||
@ -1255,18 +1135,13 @@ IN_PROC_BROWSER_TEST_F(WizardControllerDeviceStateTest,
|
||||
std::move(device_state));
|
||||
|
||||
EXPECT_CALL(*mock_network_screen_, ShowImpl()).Times(1);
|
||||
if (!features::IsOobeConsolidatedConsentEnabled())
|
||||
EXPECT_CALL(*mock_eula_screen_, ShowImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_update_screen_, ShowImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_auto_enrollment_check_screen_, ShowImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_enrollment_screen_, ShowImpl()).Times(1);
|
||||
|
||||
mock_welcome_screen_->ExitScreen(WelcomeScreen::Result::NEXT);
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
if (!features::IsOobeConsolidatedConsentEnabled()) {
|
||||
mock_eula_screen_->ExitScreen(
|
||||
EulaScreen::Result::ACCEPTED_WITHOUT_USAGE_STATS_REPORTING);
|
||||
}
|
||||
|
||||
base::RunLoop().RunUntilIdle();
|
||||
mock_update_screen_->RunExit(UpdateScreen::Result::UPDATE_NOT_REQUIRED);
|
||||
mock_auto_enrollment_check_screen_->ExitScreen();
|
||||
@ -1294,18 +1169,7 @@ IN_PROC_BROWSER_TEST_F(WizardControllerDeviceStateTest,
|
||||
EXPECT_CALL(*mock_network_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_update_screen_, ShowImpl()).Times(1);
|
||||
|
||||
if (features::IsOobeConsolidatedConsentEnabled()) {
|
||||
// EULA screen is skipped when OobeConsolidatedConsent is enabled.
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
} else {
|
||||
EXPECT_CALL(*mock_eula_screen_, ShowImpl()).Times(1);
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
CheckCurrentScreen(EulaView::kScreenId);
|
||||
EXPECT_CALL(*mock_eula_screen_, HideImpl()).Times(1);
|
||||
mock_eula_screen_->ExitScreen(
|
||||
EulaScreen::Result::ACCEPTED_WITHOUT_USAGE_STATS_REPORTING);
|
||||
}
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
// Let update screen smooth time process (time = 0ms).
|
||||
content::RunAllPendingInMessageLoop();
|
||||
@ -1397,18 +1261,7 @@ IN_PROC_BROWSER_TEST_P(WizardControllerDeviceStateExplicitRequirementTest,
|
||||
EXPECT_CALL(*mock_network_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_update_screen_, ShowImpl()).Times(1);
|
||||
|
||||
if (features::IsOobeConsolidatedConsentEnabled()) {
|
||||
// EULA screen is skipped when OobeConsolidatedConsent is enabled.
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
} else {
|
||||
EXPECT_CALL(*mock_eula_screen_, ShowImpl()).Times(1);
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
CheckCurrentScreen(EulaView::kScreenId);
|
||||
EXPECT_CALL(*mock_eula_screen_, HideImpl()).Times(1);
|
||||
mock_eula_screen_->ExitScreen(
|
||||
EulaScreen::Result::ACCEPTED_WITHOUT_USAGE_STATS_REPORTING);
|
||||
}
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
// Let update screen smooth time process (time = 0ms).
|
||||
base::RunLoop().RunUntilIdle();
|
||||
@ -1489,18 +1342,7 @@ IN_PROC_BROWSER_TEST_P(WizardControllerDeviceStateExplicitRequirementTest,
|
||||
EXPECT_CALL(*mock_network_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_update_screen_, ShowImpl()).Times(1);
|
||||
|
||||
if (features::IsOobeConsolidatedConsentEnabled()) {
|
||||
// EULA screen is skipped when OobeConsolidatedConsent is enabled.
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
} else {
|
||||
EXPECT_CALL(*mock_eula_screen_, ShowImpl()).Times(1);
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
CheckCurrentScreen(EulaView::kScreenId);
|
||||
EXPECT_CALL(*mock_eula_screen_, HideImpl()).Times(1);
|
||||
mock_eula_screen_->ExitScreen(
|
||||
EulaScreen::Result::ACCEPTED_WITHOUT_USAGE_STATS_REPORTING);
|
||||
}
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
// Let update screen smooth time process (time = 0ms).
|
||||
base::RunLoop().RunUntilIdle();
|
||||
@ -1634,18 +1476,7 @@ class WizardControllerDeviceStateWithInitialEnrollmentTest
|
||||
EXPECT_CALL(*mock_network_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_update_screen_, ShowImpl()).Times(1);
|
||||
|
||||
if (features::IsOobeConsolidatedConsentEnabled()) {
|
||||
// EULA screen is skipped when OobeConsolidatedConsent is enabled.
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
} else {
|
||||
EXPECT_CALL(*mock_eula_screen_, ShowImpl()).Times(1);
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
CheckCurrentScreen(EulaView::kScreenId);
|
||||
EXPECT_CALL(*mock_eula_screen_, HideImpl()).Times(1);
|
||||
mock_eula_screen_->ExitScreen(
|
||||
EulaScreen::Result::ACCEPTED_WITHOUT_USAGE_STATS_REPORTING);
|
||||
}
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
if (check_fre) {
|
||||
// Wait for auto-enrollment controller to encounter the connection error.
|
||||
@ -1751,18 +1582,7 @@ IN_PROC_BROWSER_TEST_F(WizardControllerDeviceStateWithInitialEnrollmentTest,
|
||||
EXPECT_CALL(*mock_network_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_update_screen_, ShowImpl()).Times(1);
|
||||
|
||||
if (features::IsOobeConsolidatedConsentEnabled()) {
|
||||
// EULA screen is skipped when OobeConsolidatedConsent is enabled.
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
} else {
|
||||
EXPECT_CALL(*mock_eula_screen_, ShowImpl()).Times(1);
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
CheckCurrentScreen(EulaView::kScreenId);
|
||||
EXPECT_CALL(*mock_eula_screen_, HideImpl()).Times(1);
|
||||
mock_eula_screen_->ExitScreen(
|
||||
EulaScreen::Result::ACCEPTED_WITHOUT_USAGE_STATS_REPORTING);
|
||||
}
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
// Let update screen smooth time process (time = 0ms).
|
||||
base::RunLoop().RunUntilIdle();
|
||||
@ -1842,18 +1662,7 @@ IN_PROC_BROWSER_TEST_F(WizardControllerDeviceStateWithInitialEnrollmentTest,
|
||||
EXPECT_CALL(*mock_network_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_update_screen_, ShowImpl()).Times(1);
|
||||
|
||||
if (features::IsOobeConsolidatedConsentEnabled()) {
|
||||
// EULA screen is skipped when OobeConsolidatedConsent is enabled.
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
} else {
|
||||
EXPECT_CALL(*mock_eula_screen_, ShowImpl()).Times(1);
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
CheckCurrentScreen(EulaView::kScreenId);
|
||||
EXPECT_CALL(*mock_eula_screen_, HideImpl()).Times(1);
|
||||
mock_eula_screen_->ExitScreen(
|
||||
EulaScreen::Result::ACCEPTED_WITHOUT_USAGE_STATS_REPORTING);
|
||||
}
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
// Let update screen smooth time process (time = 0ms).
|
||||
base::RunLoop().RunUntilIdle();
|
||||
@ -1886,18 +1695,7 @@ IN_PROC_BROWSER_TEST_F(WizardControllerDeviceStateWithInitialEnrollmentTest,
|
||||
EXPECT_CALL(*mock_network_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_update_screen_, ShowImpl()).Times(1);
|
||||
|
||||
if (features::IsOobeConsolidatedConsentEnabled()) {
|
||||
// EULA screen is skipped when OobeConsolidatedConsent is enabled.
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
} else {
|
||||
EXPECT_CALL(*mock_eula_screen_, ShowImpl()).Times(1);
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
CheckCurrentScreen(EulaView::kScreenId);
|
||||
EXPECT_CALL(*mock_eula_screen_, HideImpl()).Times(1);
|
||||
mock_eula_screen_->ExitScreen(
|
||||
EulaScreen::Result::ACCEPTED_WITHOUT_USAGE_STATS_REPORTING);
|
||||
}
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
// Let update screen smooth time process (time = 0ms).
|
||||
base::RunLoop().RunUntilIdle();
|
||||
@ -1944,18 +1742,7 @@ IN_PROC_BROWSER_TEST_F(WizardControllerDeviceStateWithInitialEnrollmentTest,
|
||||
EXPECT_CALL(*mock_network_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_update_screen_, ShowImpl()).Times(1);
|
||||
|
||||
if (features::IsOobeConsolidatedConsentEnabled()) {
|
||||
// EULA screen is skipped when OobeConsolidatedConsent is enabled.
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
} else {
|
||||
EXPECT_CALL(*mock_eula_screen_, ShowImpl()).Times(1);
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
CheckCurrentScreen(EulaView::kScreenId);
|
||||
EXPECT_CALL(*mock_eula_screen_, HideImpl()).Times(1);
|
||||
mock_eula_screen_->ExitScreen(
|
||||
EulaScreen::Result::ACCEPTED_WITHOUT_USAGE_STATS_REPORTING);
|
||||
}
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
// Let update screen smooth time process (time = 0ms).
|
||||
task_runner->RunUntilIdle();
|
||||
@ -2003,18 +1790,7 @@ IN_PROC_BROWSER_TEST_F(WizardControllerDeviceStateWithInitialEnrollmentTest,
|
||||
EXPECT_CALL(*mock_network_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_update_screen_, ShowImpl()).Times(1);
|
||||
|
||||
if (features::IsOobeConsolidatedConsentEnabled()) {
|
||||
// EULA screen is skipped when OobeConsolidatedConsent is enabled.
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
} else {
|
||||
EXPECT_CALL(*mock_eula_screen_, ShowImpl()).Times(1);
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
CheckCurrentScreen(EulaView::kScreenId);
|
||||
EXPECT_CALL(*mock_eula_screen_, HideImpl()).Times(1);
|
||||
mock_eula_screen_->ExitScreen(
|
||||
EulaScreen::Result::ACCEPTED_WITHOUT_USAGE_STATS_REPORTING);
|
||||
}
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
// Let update screen smooth time process (time = 0ms).
|
||||
base::RunLoop().RunUntilIdle();
|
||||
@ -2090,16 +1866,8 @@ IN_PROC_BROWSER_TEST_F(WizardControllerScreenPriorityOOBETest,
|
||||
NetworkScreenView::kScreenId);
|
||||
CheckCurrentScreen(NetworkScreenView::kScreenId);
|
||||
|
||||
if (!features::IsOobeConsolidatedConsentEnabled()) {
|
||||
// Showing eula screen should pass it has default priority which is same as
|
||||
// network screen.
|
||||
WizardController::default_controller()->AdvanceToScreen(
|
||||
EulaView::kScreenId);
|
||||
CheckCurrentScreen(EulaView::kScreenId);
|
||||
}
|
||||
|
||||
// Showing update screen should pass it has default priority which is same as
|
||||
// eula screen.
|
||||
// network screen.
|
||||
WizardController::default_controller()->AdvanceToScreen(
|
||||
UpdateView::kScreenId);
|
||||
CheckCurrentScreen(UpdateView::kScreenId);
|
||||
@ -2286,18 +2054,7 @@ IN_PROC_BROWSER_TEST_F(WizardControllerKioskFlowTest,
|
||||
EXPECT_CALL(*mock_network_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_update_screen_, ShowImpl()).Times(1);
|
||||
|
||||
if (features::IsOobeConsolidatedConsentEnabled()) {
|
||||
// EULA screen is skipped when OobeConsolidatedConsent is enabled.
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
} else {
|
||||
EXPECT_CALL(*mock_eula_screen_, ShowImpl()).Times(1);
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
CheckCurrentScreen(EulaView::kScreenId);
|
||||
EXPECT_CALL(*mock_eula_screen_, HideImpl()).Times(1);
|
||||
mock_eula_screen_->ExitScreen(
|
||||
EulaScreen::Result::ACCEPTED_WITHOUT_USAGE_STATS_REPORTING);
|
||||
}
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
// Let update screen smooth time process (time = 0ms).
|
||||
content::RunAllPendingInMessageLoop();
|
||||
@ -2335,18 +2092,7 @@ IN_PROC_BROWSER_TEST_F(WizardControllerKioskFlowTest,
|
||||
EXPECT_CALL(*mock_network_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_update_screen_, ShowImpl()).Times(1);
|
||||
|
||||
if (features::IsOobeConsolidatedConsentEnabled()) {
|
||||
// EULA screen is skipped when OobeConsolidatedConsent is enabled.
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
} else {
|
||||
EXPECT_CALL(*mock_eula_screen_, ShowImpl()).Times(1);
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
CheckCurrentScreen(EulaView::kScreenId);
|
||||
EXPECT_CALL(*mock_eula_screen_, HideImpl()).Times(1);
|
||||
mock_eula_screen_->ExitScreen(
|
||||
EulaScreen::Result::ACCEPTED_WITHOUT_USAGE_STATS_REPORTING);
|
||||
}
|
||||
mock_network_screen_->ExitScreen(NetworkScreen::Result::CONNECTED);
|
||||
|
||||
// Let update screen smooth time process (time = 0ms).
|
||||
content::RunAllPendingInMessageLoop();
|
||||
@ -2524,63 +2270,25 @@ IN_PROC_BROWSER_TEST_F(WizardControllerDemoSetupTest,
|
||||
EXPECT_TRUE(DemoSetupController::IsOobeDemoSetupFlowInProgress());
|
||||
EXPECT_CALL(*mock_demo_preferences_screen_, HideImpl()).Times(1);
|
||||
|
||||
if (features::IsOobeConsolidatedConsentEnabled()) {
|
||||
// If OobeConsolidatedConsent is enabled, the flow will be updated to:
|
||||
// Network -> Update -> Consolidated Consent -> Auto Enrollment.
|
||||
EXPECT_CALL(*mock_update_screen_, ShowImpl()).Times(1);
|
||||
mock_demo_preferences_screen_->ExitScreen(
|
||||
DemoPreferencesScreen::Result::COMPLETED_CONSOLIDATED_CONSENT);
|
||||
EXPECT_CALL(*mock_update_screen_, ShowImpl()).Times(1);
|
||||
mock_demo_preferences_screen_->ExitScreen(
|
||||
DemoPreferencesScreen::Result::COMPLETED_CONSOLIDATED_CONSENT);
|
||||
|
||||
base::RunLoop().RunUntilIdle();
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
CheckCurrentScreen(UpdateView::kScreenId);
|
||||
EXPECT_TRUE(DemoSetupController::IsOobeDemoSetupFlowInProgress());
|
||||
CheckCurrentScreen(UpdateView::kScreenId);
|
||||
EXPECT_TRUE(DemoSetupController::IsOobeDemoSetupFlowInProgress());
|
||||
|
||||
EXPECT_CALL(*mock_consolidated_consent_screen_, ShowImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_update_screen_, HideImpl()).Times(1);
|
||||
mock_update_screen_->RunExit(UpdateScreen::Result::UPDATE_NOT_REQUIRED);
|
||||
EXPECT_CALL(*mock_consolidated_consent_screen_, ShowImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_update_screen_, HideImpl()).Times(1);
|
||||
mock_update_screen_->RunExit(UpdateScreen::Result::UPDATE_NOT_REQUIRED);
|
||||
|
||||
EXPECT_CALL(*mock_consolidated_consent_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_auto_enrollment_check_screen_, ShowImpl()).Times(0);
|
||||
EXPECT_CALL(*mock_demo_setup_screen_, ShowImpl()).Times(1);
|
||||
mock_consolidated_consent_screen_->ExitScreen(
|
||||
ConsolidatedConsentScreen::Result::ACCEPTED_DEMO_ONLINE);
|
||||
} else {
|
||||
// The flow when OobeConsolidatedConsent is disabled:
|
||||
// Network -> EULA -> ARC ToS -> Update -> Auto Enrollment.
|
||||
EXPECT_CALL(*mock_eula_screen_, ShowImpl()).Times(1);
|
||||
mock_demo_preferences_screen_->ExitScreen(
|
||||
DemoPreferencesScreen::Result::COMPLETED);
|
||||
|
||||
CheckCurrentScreen(EulaView::kScreenId);
|
||||
EXPECT_TRUE(DemoSetupController::IsOobeDemoSetupFlowInProgress());
|
||||
|
||||
EXPECT_CALL(*mock_eula_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_arc_terms_of_service_screen_, ShowImpl()).Times(1);
|
||||
|
||||
mock_eula_screen_->ExitScreen(
|
||||
EulaScreen::Result::ACCEPTED_WITHOUT_USAGE_STATS_REPORTING);
|
||||
|
||||
CheckCurrentScreen(ArcTermsOfServiceScreenView::kScreenId);
|
||||
EXPECT_TRUE(DemoSetupController::IsOobeDemoSetupFlowInProgress());
|
||||
|
||||
EXPECT_CALL(*mock_arc_terms_of_service_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_update_screen_, ShowImpl()).Times(1);
|
||||
|
||||
mock_arc_terms_of_service_screen_->ExitScreen(
|
||||
ArcTermsOfServiceScreen::Result::ACCEPTED_DEMO_ONLINE);
|
||||
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
CheckCurrentScreen(UpdateView::kScreenId);
|
||||
EXPECT_TRUE(DemoSetupController::IsOobeDemoSetupFlowInProgress());
|
||||
|
||||
EXPECT_CALL(*mock_update_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_auto_enrollment_check_screen_, ShowImpl()).Times(0);
|
||||
EXPECT_CALL(*mock_demo_setup_screen_, ShowImpl()).Times(1);
|
||||
|
||||
mock_update_screen_->RunExit(UpdateScreen::Result::UPDATE_NOT_REQUIRED);
|
||||
}
|
||||
EXPECT_CALL(*mock_consolidated_consent_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_auto_enrollment_check_screen_, ShowImpl()).Times(0);
|
||||
EXPECT_CALL(*mock_demo_setup_screen_, ShowImpl()).Times(1);
|
||||
mock_consolidated_consent_screen_->ExitScreen(
|
||||
ConsolidatedConsentScreen::Result::ACCEPTED_DEMO_ONLINE);
|
||||
|
||||
EXPECT_TRUE(DemoSetupController::IsOobeDemoSetupFlowInProgress());
|
||||
|
||||
@ -2620,63 +2328,25 @@ IN_PROC_BROWSER_TEST_F(WizardControllerDemoSetupTest, DemoSetupCanceled) {
|
||||
EXPECT_CALL(*mock_demo_preferences_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_update_screen_, ShowImpl()).Times(1);
|
||||
|
||||
if (features::IsOobeConsolidatedConsentEnabled()) {
|
||||
// If OobeConsolidatedConsent is enabled, the flow will be updated to:
|
||||
// Network -> Update -> Consolidated Consent -> Auto Enrollment.
|
||||
mock_demo_preferences_screen_->ExitScreen(
|
||||
DemoPreferencesScreen::Result::COMPLETED_CONSOLIDATED_CONSENT);
|
||||
mock_demo_preferences_screen_->ExitScreen(
|
||||
DemoPreferencesScreen::Result::COMPLETED_CONSOLIDATED_CONSENT);
|
||||
|
||||
CheckCurrentScreen(UpdateView::kScreenId);
|
||||
EXPECT_TRUE(DemoSetupController::IsOobeDemoSetupFlowInProgress());
|
||||
CheckCurrentScreen(UpdateView::kScreenId);
|
||||
EXPECT_TRUE(DemoSetupController::IsOobeDemoSetupFlowInProgress());
|
||||
|
||||
EXPECT_CALL(*mock_update_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_consolidated_consent_screen_, ShowImpl()).Times(1);
|
||||
mock_update_screen_->RunExit(UpdateScreen::Result::UPDATE_NOT_REQUIRED);
|
||||
EXPECT_CALL(*mock_update_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_consolidated_consent_screen_, ShowImpl()).Times(1);
|
||||
mock_update_screen_->RunExit(UpdateScreen::Result::UPDATE_NOT_REQUIRED);
|
||||
|
||||
CheckCurrentScreen(ConsolidatedConsentScreenView::kScreenId);
|
||||
EXPECT_TRUE(DemoSetupController::IsOobeDemoSetupFlowInProgress());
|
||||
CheckCurrentScreen(ConsolidatedConsentScreenView::kScreenId);
|
||||
EXPECT_TRUE(DemoSetupController::IsOobeDemoSetupFlowInProgress());
|
||||
|
||||
EXPECT_CALL(*mock_consolidated_consent_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_auto_enrollment_check_screen_, ShowImpl()).Times(0);
|
||||
EXPECT_CALL(*mock_demo_setup_screen_, ShowImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_consolidated_consent_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_auto_enrollment_check_screen_, ShowImpl()).Times(0);
|
||||
EXPECT_CALL(*mock_demo_setup_screen_, ShowImpl()).Times(1);
|
||||
|
||||
mock_consolidated_consent_screen_->ExitScreen(
|
||||
ConsolidatedConsentScreen::Result::ACCEPTED_DEMO_ONLINE);
|
||||
} else {
|
||||
// The flow when OobeConsolidatedConsent is disabled:
|
||||
// Network -> EULA -> ARC ToS -> Update -> Auto Enrollment.
|
||||
EXPECT_CALL(*mock_eula_screen_, ShowImpl()).Times(1);
|
||||
|
||||
mock_demo_preferences_screen_->ExitScreen(
|
||||
DemoPreferencesScreen::Result::COMPLETED);
|
||||
|
||||
CheckCurrentScreen(EulaView::kScreenId);
|
||||
EXPECT_TRUE(DemoSetupController::IsOobeDemoSetupFlowInProgress());
|
||||
|
||||
EXPECT_CALL(*mock_eula_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_arc_terms_of_service_screen_, ShowImpl()).Times(1);
|
||||
|
||||
mock_eula_screen_->ExitScreen(
|
||||
EulaScreen::Result::ACCEPTED_WITHOUT_USAGE_STATS_REPORTING);
|
||||
|
||||
CheckCurrentScreen(ArcTermsOfServiceScreenView::kScreenId);
|
||||
EXPECT_TRUE(DemoSetupController::IsOobeDemoSetupFlowInProgress());
|
||||
|
||||
EXPECT_CALL(*mock_arc_terms_of_service_screen_, HideImpl()).Times(1);
|
||||
|
||||
mock_arc_terms_of_service_screen_->ExitScreen(
|
||||
ArcTermsOfServiceScreen::Result::ACCEPTED_DEMO_ONLINE);
|
||||
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
CheckCurrentScreen(UpdateView::kScreenId);
|
||||
EXPECT_TRUE(DemoSetupController::IsOobeDemoSetupFlowInProgress());
|
||||
|
||||
EXPECT_CALL(*mock_update_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_auto_enrollment_check_screen_, ShowImpl()).Times(0);
|
||||
EXPECT_CALL(*mock_demo_setup_screen_, ShowImpl()).Times(1);
|
||||
mock_update_screen_->RunExit(UpdateScreen::Result::UPDATE_NOT_REQUIRED);
|
||||
}
|
||||
mock_consolidated_consent_screen_->ExitScreen(
|
||||
ConsolidatedConsentScreen::Result::ACCEPTED_DEMO_ONLINE);
|
||||
|
||||
EXPECT_TRUE(DemoSetupController::IsOobeDemoSetupFlowInProgress());
|
||||
EXPECT_CALL(*mock_auto_enrollment_check_screen_, HideImpl()).Times(0);
|
||||
@ -2736,78 +2406,6 @@ IN_PROC_BROWSER_TEST_F(WizardControllerDemoSetupTest, NetworkBackPressed) {
|
||||
EXPECT_FALSE(DemoSetupController::IsOobeDemoSetupFlowInProgress());
|
||||
}
|
||||
|
||||
IN_PROC_BROWSER_TEST_F(WizardControllerDemoSetupTest, EulaBackPressed) {
|
||||
// EULA screen will be skipped if the OobeConsolidatedConsent is enabled.
|
||||
if (features::IsOobeConsolidatedConsentEnabled())
|
||||
return;
|
||||
|
||||
CheckCurrentScreen(WelcomeView::kScreenId);
|
||||
EXPECT_FALSE(DemoSetupController::IsOobeDemoSetupFlowInProgress());
|
||||
SkipToScreen(EulaView::kScreenId, mock_eula_screen_);
|
||||
|
||||
CheckCurrentScreen(EulaView::kScreenId);
|
||||
EXPECT_TRUE(DemoSetupController::IsOobeDemoSetupFlowInProgress());
|
||||
|
||||
EXPECT_CALL(*mock_eula_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_demo_preferences_screen_, ShowImpl()).Times(1);
|
||||
|
||||
mock_eula_screen_->ExitScreen(EulaScreen::Result::BACK_DEMO_MODE);
|
||||
|
||||
CheckCurrentScreen(DemoPreferencesScreenView::kScreenId);
|
||||
EXPECT_TRUE(DemoSetupController::IsOobeDemoSetupFlowInProgress());
|
||||
}
|
||||
|
||||
IN_PROC_BROWSER_TEST_F(WizardControllerDemoSetupTest, ArcTosBackPressed) {
|
||||
// ARC ToS screen will be skipped if the OobeConsolidatedConsent is enabled.
|
||||
if (features::IsOobeConsolidatedConsentEnabled())
|
||||
return;
|
||||
|
||||
CheckCurrentScreen(WelcomeView::kScreenId);
|
||||
EXPECT_FALSE(DemoSetupController::IsOobeDemoSetupFlowInProgress());
|
||||
|
||||
// User cannot go to ARC ToS screen without accepting eula - simulate that.
|
||||
StartupUtils::MarkEulaAccepted();
|
||||
SkipToScreen(ArcTermsOfServiceScreenView::kScreenId,
|
||||
mock_arc_terms_of_service_screen_);
|
||||
|
||||
CheckCurrentScreen(ArcTermsOfServiceScreenView::kScreenId);
|
||||
EXPECT_TRUE(DemoSetupController::IsOobeDemoSetupFlowInProgress());
|
||||
|
||||
EXPECT_CALL(*mock_arc_terms_of_service_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_demo_preferences_screen_, ShowImpl()).Times(1);
|
||||
|
||||
mock_arc_terms_of_service_screen_->ExitScreen(
|
||||
ArcTermsOfServiceScreen::Result::BACK);
|
||||
|
||||
CheckCurrentScreen(DemoPreferencesScreenView::kScreenId);
|
||||
EXPECT_TRUE(DemoSetupController::IsOobeDemoSetupFlowInProgress());
|
||||
}
|
||||
|
||||
IN_PROC_BROWSER_TEST_F(WizardControllerDemoSetupTest,
|
||||
ConsolidatedConsentBackPressed) {
|
||||
if (!features::IsOobeConsolidatedConsentEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
CheckCurrentScreen(WelcomeView::kScreenId);
|
||||
EXPECT_FALSE(DemoSetupController::IsOobeDemoSetupFlowInProgress());
|
||||
|
||||
SkipToScreen(ConsolidatedConsentScreenView::kScreenId,
|
||||
mock_consolidated_consent_screen_);
|
||||
|
||||
CheckCurrentScreen(ConsolidatedConsentScreenView::kScreenId);
|
||||
EXPECT_TRUE(DemoSetupController::IsOobeDemoSetupFlowInProgress());
|
||||
|
||||
EXPECT_CALL(*mock_consolidated_consent_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_demo_preferences_screen_, ShowImpl()).Times(1);
|
||||
|
||||
mock_consolidated_consent_screen_->ExitScreen(
|
||||
ConsolidatedConsentScreen::Result::BACK_DEMO);
|
||||
|
||||
CheckCurrentScreen(DemoPreferencesScreenView::kScreenId);
|
||||
EXPECT_TRUE(DemoSetupController::IsOobeDemoSetupFlowInProgress());
|
||||
}
|
||||
|
||||
class WizardControllerDemoSetupDeviceDisabledTest
|
||||
: public WizardControllerDeviceStateTest {
|
||||
public:
|
||||
@ -2851,58 +2449,23 @@ IN_PROC_BROWSER_TEST_F(WizardControllerDemoSetupDeviceDisabledTest,
|
||||
EXPECT_CALL(*mock_demo_preferences_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_update_screen_, ShowImpl()).Times(1);
|
||||
|
||||
if (features::IsOobeConsolidatedConsentEnabled()) {
|
||||
// If OobeConsolidatedConsent is enabled, the flow will be updated to:
|
||||
// Network -> Update -> Consolidated Consent -> Auto Enrollment.
|
||||
// Network -> Update -> Consolidated Consent -> Auto Enrollment.
|
||||
mock_demo_preferences_screen_->ExitScreen(
|
||||
DemoPreferencesScreen::Result::COMPLETED_CONSOLIDATED_CONSENT);
|
||||
|
||||
mock_demo_preferences_screen_->ExitScreen(
|
||||
DemoPreferencesScreen::Result::COMPLETED_CONSOLIDATED_CONSENT);
|
||||
CheckCurrentScreen(UpdateView::kScreenId);
|
||||
EXPECT_CALL(*mock_update_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_consolidated_consent_screen_, ShowImpl()).Times(1);
|
||||
mock_update_screen_->RunExit(UpdateScreen::Result::UPDATE_NOT_REQUIRED);
|
||||
|
||||
CheckCurrentScreen(UpdateView::kScreenId);
|
||||
EXPECT_CALL(*mock_update_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_consolidated_consent_screen_, ShowImpl()).Times(1);
|
||||
mock_update_screen_->RunExit(UpdateScreen::Result::UPDATE_NOT_REQUIRED);
|
||||
CheckCurrentScreen(ConsolidatedConsentScreenView::kScreenId);
|
||||
EXPECT_TRUE(DemoSetupController::IsOobeDemoSetupFlowInProgress());
|
||||
|
||||
CheckCurrentScreen(ConsolidatedConsentScreenView::kScreenId);
|
||||
EXPECT_TRUE(DemoSetupController::IsOobeDemoSetupFlowInProgress());
|
||||
EXPECT_CALL(*mock_consolidated_consent_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_auto_enrollment_check_screen_, ShowImpl()).Times(1);
|
||||
|
||||
EXPECT_CALL(*mock_consolidated_consent_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_auto_enrollment_check_screen_, ShowImpl()).Times(1);
|
||||
|
||||
mock_consolidated_consent_screen_->ExitScreen(
|
||||
ConsolidatedConsentScreen::Result::ACCEPTED_DEMO_ONLINE);
|
||||
} else {
|
||||
// The flow when OobeConsolidatedConsent is disabled:
|
||||
// Network -> EULA -> ARC ToS -> Update -> Auto Enrollment.
|
||||
EXPECT_CALL(*mock_eula_screen_, ShowImpl()).Times(1);
|
||||
|
||||
mock_demo_preferences_screen_->ExitScreen(
|
||||
DemoPreferencesScreen::Result::COMPLETED);
|
||||
|
||||
CheckCurrentScreen(EulaView::kScreenId);
|
||||
EXPECT_TRUE(DemoSetupController::IsOobeDemoSetupFlowInProgress());
|
||||
|
||||
EXPECT_CALL(*mock_eula_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_arc_terms_of_service_screen_, ShowImpl()).Times(1);
|
||||
mock_eula_screen_->ExitScreen(
|
||||
EulaScreen::Result::ACCEPTED_WITHOUT_USAGE_STATS_REPORTING);
|
||||
|
||||
CheckCurrentScreen(ArcTermsOfServiceScreenView::kScreenId);
|
||||
EXPECT_TRUE(DemoSetupController::IsOobeDemoSetupFlowInProgress());
|
||||
|
||||
EXPECT_CALL(*mock_arc_terms_of_service_screen_, HideImpl()).Times(1);
|
||||
|
||||
mock_arc_terms_of_service_screen_->ExitScreen(
|
||||
ArcTermsOfServiceScreen::Result::ACCEPTED_DEMO_ONLINE);
|
||||
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
CheckCurrentScreen(UpdateView::kScreenId);
|
||||
EXPECT_TRUE(DemoSetupController::IsOobeDemoSetupFlowInProgress());
|
||||
EXPECT_CALL(*mock_update_screen_, HideImpl()).Times(1);
|
||||
EXPECT_CALL(*mock_auto_enrollment_check_screen_, ShowImpl()).Times(1);
|
||||
mock_update_screen_->RunExit(UpdateScreen::Result::UPDATE_NOT_REQUIRED);
|
||||
}
|
||||
mock_consolidated_consent_screen_->ExitScreen(
|
||||
ConsolidatedConsentScreen::Result::ACCEPTED_DEMO_ONLINE);
|
||||
|
||||
CheckCurrentScreen(AutoEnrollmentCheckScreenView::kScreenId);
|
||||
EXPECT_TRUE(DemoSetupController::IsOobeDemoSetupFlowInProgress());
|
||||
|
@ -194,33 +194,6 @@ class NetworkScreenTester extends ScreenElementApi {
|
||||
}
|
||||
}
|
||||
|
||||
class EulaScreenTester extends ScreenElementApi {
|
||||
constructor() {
|
||||
super('oobe-eula-md');
|
||||
this.eulaStep = new PolymerElementApi(this, '#eulaDialog');
|
||||
this.nextButton = new PolymerElementApi(this, '#acceptButton');
|
||||
}
|
||||
|
||||
/** @override */
|
||||
shouldSkip() {
|
||||
// Eula screen should skipped on non-branded build and on CfM devices.
|
||||
return loadTimeData.getBoolean('testapi_shouldSkipEula');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if the EULA Screen is ready for test interaction.
|
||||
* @return {boolean}
|
||||
*/
|
||||
isReadyForTesting() {
|
||||
return this.isVisible() && this.eulaStep.isVisible() &&
|
||||
this.nextButton.isVisible();
|
||||
}
|
||||
|
||||
getNextButtonName() {
|
||||
return loadTimeData.getString('oobeEulaAcceptAndContinueButtonText');
|
||||
}
|
||||
}
|
||||
|
||||
class UpdateScreenTester extends ScreenElementApi {
|
||||
constructor() {
|
||||
super('oobe-update');
|
||||
@ -808,7 +781,6 @@ export class OobeApiProvider {
|
||||
HIDDetectionScreen: new HIDDetectionScreenTester(),
|
||||
WelcomeScreen: new WelcomeScreenTester(),
|
||||
NetworkScreen: new NetworkScreenTester(),
|
||||
EulaScreen: new EulaScreenTester(),
|
||||
UpdateScreen: new UpdateScreenTester(),
|
||||
EnrollmentScreen: new EnrollmentScreenTester(),
|
||||
UserCreationScreen: new UserCreationScreenTester(),
|
||||
|
@ -48,18 +48,6 @@ IN_PROC_BROWSER_TEST_F(OobeTestApiTest, OobeAPI) {
|
||||
.CreateWaiter("OobeAPI.screens.NetworkScreen.isVisible()")
|
||||
->Wait();
|
||||
test::OobeJS().Evaluate("OobeAPI.screens.NetworkScreen.clickNext()");
|
||||
|
||||
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
||||
if (!features::IsOobeConsolidatedConsentEnabled()) {
|
||||
test::OobeJS().ExpectFalse("OobeAPI.screens.EulaScreen.shouldSkip()");
|
||||
test::OobeJS()
|
||||
.CreateWaiter("OobeAPI.screens.EulaScreen.isReadyForTesting()")
|
||||
->Wait();
|
||||
test::OobeJS().Evaluate("OobeAPI.screens.EulaScreen.clickNext()");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
test::OobeJS().ExpectTrue("OobeAPI.screens.EulaScreen.shouldSkip()");
|
||||
}
|
||||
|
||||
class OobeTestApiTestChromebox : public OobeTestApiTest {
|
||||
@ -145,10 +133,6 @@ class OobeTestApiRemoraRequisitionTest : public OobeTestApiTest,
|
||||
LocalStateMixin local_state_mixin_{&mixin_host_, this};
|
||||
};
|
||||
|
||||
IN_PROC_BROWSER_TEST_F(OobeTestApiRemoraRequisitionTest, SkipsEula) {
|
||||
test::OobeJS().ExpectTrue("OobeAPI.screens.EulaScreen.shouldSkip()");
|
||||
}
|
||||
|
||||
class OobeTestApiLoginPinTest : public OobeTestApiTest {
|
||||
public:
|
||||
OobeTestApiLoginPinTest() { login_mixin_.AppendRegularUsers(1); }
|
||||
|
@ -67,11 +67,6 @@ void OobeTestAPIHandler::GetAdditionalParameters(base::Value::Dict* dict) {
|
||||
features::IsOobeNetworkScreenSkipEnabled() &&
|
||||
!switches::IsOOBENetworkScreenSkippingDisabledForTesting() &&
|
||||
helper_.IsConnectedToEthernet());
|
||||
dict->Set("testapi_shouldSkipEula",
|
||||
policy::EnrollmentRequisitionManager::IsRemoraRequisition() ||
|
||||
StartupUtils::IsEulaAccepted() ||
|
||||
features::IsOobeConsolidatedConsentEnabled() ||
|
||||
!BUILDFLAG(GOOGLE_CHROME_BRANDING));
|
||||
|
||||
dict->Set("testapi_shouldSkipGuestTos",
|
||||
StartupUtils::IsEulaAccepted() ||
|
||||
|
@ -3801,7 +3801,6 @@ if (!is_android) {
|
||||
"../browser/ash/login/enrollment/mock_auto_enrollment_check_screen.h",
|
||||
"../browser/ash/login/enterprise_enrollment_browsertest.cc",
|
||||
"../browser/ash/login/error_screen_browsertest.cc",
|
||||
"../browser/ash/login/eula_browsertest.cc",
|
||||
"../browser/ash/login/existing_user_controller_browsertest.cc",
|
||||
"../browser/ash/login/extensions/login_screen_extensions_content_script_manager_browsertest.cc",
|
||||
"../browser/ash/login/extensions/login_screen_extensions_lifetime_manager_browsertest.cc",
|
||||
@ -3866,8 +3865,6 @@ if (!is_android) {
|
||||
"../browser/ash/login/screens/mock_enable_adb_sideloading_screen.h",
|
||||
"../browser/ash/login/screens/mock_enable_debugging_screen.cc",
|
||||
"../browser/ash/login/screens/mock_enable_debugging_screen.h",
|
||||
"../browser/ash/login/screens/mock_eula_screen.cc",
|
||||
"../browser/ash/login/screens/mock_eula_screen.h",
|
||||
"../browser/ash/login/screens/mock_wrong_hwid_screen.cc",
|
||||
"../browser/ash/login/screens/mock_wrong_hwid_screen.h",
|
||||
"../browser/ash/login/screens/multidevice_setup_screen_browsertest.cc",
|
||||
|
Reference in New Issue
Block a user