Commit ad1d34a8 authored by kumarniranjan's avatar kumarniranjan Committed by Commit bot

Remove 3 minute OOBE delay.

The delay not fix the bug on Rialto, so I'm removing it.

BUG=chromium:710716
TEST=unit test

Review-Url: https://codereview.chromium.org/2854393003
Cr-Commit-Position: refs/heads/master@{#469366}
parent a16438df
......@@ -360,15 +360,12 @@ void NetworkScreen::StopWaitingForConnection(const base::string16& network_id) {
view_->ShowConnectingStatus(false, network_id_);
GetContextEditor().SetBoolean(kContextKeyContinueButtonEnabled, is_connected);
// Automatically continue if we are using Hands-Off Enrollment.
if (is_connected && continue_attempts_ == 0 &&
policy::DeviceCloudPolicyManagerChromeOS::GetZeroTouchEnrollmentMode() ==
policy::ZeroTouchEnrollmentMode::HANDS_OFF) {
// Call OnContinueButtonPressed after 3 minutes.
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE,
base::Bind(&NetworkScreen::OnContinueButtonPressed,
weak_factory_.GetWeakPtr()),
base::TimeDelta::FromMinutes(3));
OnContinueButtonPressed();
}
}
......
......@@ -32,14 +32,6 @@ class NetworkScreenUnitTest : public testing::Test {
public:
NetworkScreenUnitTest() {}
base::ScopedMockTimeMessageLoopTaskRunner* GetTestMessageLoopTaskRunner() {
return &runner_;
}
void FastForwardTime(base::TimeDelta time) {
runner_.task_runner()->FastForwardBy(time);
}
// testing::Test:
void SetUp() override {
// Initialize the thread manager.
......@@ -83,7 +75,6 @@ class NetworkScreenUnitTest : public testing::Test {
private:
// Test versions of core browser infrastructure.
content::TestBrowserThreadBundle threads_;
base::ScopedMockTimeMessageLoopTaskRunner runner_;
// More accessory objects needed by NetworkScreen.
MockNetworkView mock_view_;
......@@ -98,10 +89,6 @@ class NetworkScreenUnitTest : public testing::Test {
};
TEST_F(NetworkScreenUnitTest, ContinuesAutomatically) {
// Verify that we are using the right TaskRunner.
EXPECT_EQ(GetTestMessageLoopTaskRunner()->task_runner(),
base::MessageLoop::current()->task_runner().get());
// Set expectation that NetworkScreen will finish.
EXPECT_CALL(mock_base_screen_delegate_,
OnExit(_, ScreenExitCode::NETWORK_CONNECTED, _))
......@@ -113,18 +100,11 @@ TEST_F(NetworkScreenUnitTest, ContinuesAutomatically) {
.WillRepeatedly((Return(true)));
network_screen_->UpdateStatus();
// Fast forward time by 3 minutes.
FastForwardTime(base::TimeDelta::FromMinutes(3));
// Check that we continued once
EXPECT_EQ(1, network_screen_->continue_attempts_);
}
TEST_F(NetworkScreenUnitTest, ContinuesOnlyOnce) {
// Verify that we are using the right TaskRunner.
EXPECT_EQ(GetTestMessageLoopTaskRunner()->task_runner(),
base::MessageLoop::current()->task_runner().get());
// Set expectation that NetworkScreen will finish.
EXPECT_CALL(mock_base_screen_delegate_,
OnExit(_, ScreenExitCode::NETWORK_CONNECTED, _))
......@@ -141,18 +121,12 @@ TEST_F(NetworkScreenUnitTest, ContinuesOnlyOnce) {
// Stop waiting for net0.
network_screen_->StopWaitingForConnection(base::ASCIIToUTF16("net0"));
// Fast forward time by 3 minutes.
FastForwardTime(base::TimeDelta::FromMinutes(3));
// Check that we have continued exactly once.
ASSERT_EQ(1, network_screen_->continue_attempts_);
// Stop waiting for another network, net1.
network_screen_->StopWaitingForConnection(base::ASCIIToUTF16("net1"));
// Fast forward time by 3 minutes.
FastForwardTime(base::TimeDelta::FromMinutes(3));
// Check that we have still continued only once.
EXPECT_EQ(1, network_screen_->continue_attempts_);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment