Commit 8c1ec4c0 authored by Saurabh Nijhara's avatar Saurabh Nijhara Committed by Commit Bot

Extract out HID test for Chromebook.

The test was based on the assumption that the wizard controller is
recreated in the login display host and hence, had the expectations
according to that. If instead the wizard controller object is reused,
this test fails the expectations.
We were set the device type in the class constructor and invoking the
login wizard in SetUpOnMainThread(). Due to this, when the device type
is changed to Chromebook in the test, the test assumed that invoking
login wizard would recreate wizard controller with no HID screen.
Hence, extracting out the test to a separate class and setting the device
type to Chromebook in it's constructor.

Bug: 1064271
Change-Id: I23e57dcedf3e1ea6d8e37bf8064784d8e27a5d9c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2135615
Commit-Queue: Saurabh Nijhara <snijhara@google.com>
Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#756541}
parent 5356ce47
......@@ -10,6 +10,7 @@
#include "chrome/browser/chromeos/login/login_wizard.h"
#include "chrome/browser/chromeos/login/screens/base_screen.h"
#include "chrome/browser/chromeos/login/screens/hid_detection_screen.h"
#include "chrome/browser/chromeos/login/test/oobe_base_test.h"
#include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h"
#include "chrome/browser/chromeos/login/wizard_controller.h"
#include "chrome/browser/ui/webui/chromeos/login/hid_detection_screen_handler.h"
......@@ -102,12 +103,18 @@ class HIDDetectionScreenTest : public InProcessBrowserTest {
DISALLOW_COPY_AND_ASSIGN(HIDDetectionScreenTest);
};
IN_PROC_BROWSER_TEST_F(HIDDetectionScreenTest, HIDDetectionScreenNotAllowed) {
// Set device type to one that should not invoke HIDDetectionScreen logic.
base::SysInfo::SetChromeOSVersionInfoForTest("DEVICETYPE=CHROMEBOOK",
base::Time::Now());
class HIDDetectionScreenChromebookTest : public OobeBaseTest {
public:
HIDDetectionScreenChromebookTest() {
// Set device type to one that should not invoke HIDDetectionScreen logic.
base::SysInfo::SetChromeOSVersionInfoForTest("DEVICETYPE=CHROMEBOOK",
base::Time::Now());
}
};
ShowLoginWizard(WelcomeView::kScreenId);
IN_PROC_BROWSER_TEST_F(HIDDetectionScreenChromebookTest,
HIDDetectionScreenNotAllowed) {
OobeScreenWaiter(WelcomeView::kScreenId).Wait();
ASSERT_TRUE(WizardController::default_controller());
EXPECT_FALSE(WizardController::default_controller()->HasScreen(
......
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