Commit c480691d authored by Noel Gordon's avatar Noel Gordon Committed by Commit Bot

Allow browser test base class to read tablet mode test state

Propagate the Table Mode (aka Ash immersive mode) test state into the
base class of the Files App test suite.

Make Tablet Mode tests enable the Ash Virtual Keyboard flag (as would
happen on real chromebook in Table Mode).

No change in test behavior: just erecting the scaffold so we can test
this aspect of Chrome OS.

Bug: 879434, 839243
Change-Id: Idfd4016698214876c991d26d1a3a8fd7dfa84bde
Reviewed-on: https://chromium-review.googlesource.com/1207783
Commit-Queue: Noel Gordon <noel@chromium.org>
Reviewed-by: default avatarStuart Langley <slangley@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589100}
parent de5059db
......@@ -15,6 +15,7 @@
#include "components/session_manager/core/session_manager.h"
#include "components/user_manager/user_manager.h"
#include "services/identity/public/cpp/identity_manager.h"
#include "ui/keyboard/keyboard_switches.h"
namespace file_manager {
......@@ -120,9 +121,11 @@ class FilesAppBrowserTest : public FileManagerBrowserTestBase,
"TrustedEventsDefaultAction");
}
// Default mode is clamshell: force Ash into tablet mode if requested.
// Default mode is clamshell: force Ash into tablet mode if requested,
// and enable the Ash virtual keyboard sub-system therein.
if (GetParam().tablet_mode) {
command_line->AppendSwitchASCII("force-tablet-mode", "touch_view");
command_line->AppendSwitch(keyboard::switches::kEnableVirtualKeyboard);
}
// TODO(crbug.com/879404): Fix tests to work with NativeSMB.
......@@ -144,15 +147,15 @@ class FilesAppBrowserTest : public FileManagerBrowserTestBase,
return "file_manager_test_manifest.json";
}
bool GetTabletMode() const override { return GetParam().tablet_mode; }
bool GetEnableDriveFs() const override { return GetParam().enable_drivefs; }
bool GetRequiresStartupBrowser() const override {
return GetParam().with_browser;
}
bool GetNeedsZipSupport() const override {
return GetParam().needs_zip;
}
bool GetNeedsZipSupport() const override { return GetParam().needs_zip; }
bool GetIsOffline() const override { return GetParam().offline; }
......
......@@ -1051,6 +1051,10 @@ void FileManagerBrowserTestBase::SetUpOnMainThread() {
test::AddDefaultComponentExtensionsOnMainThread(profile());
}
bool FileManagerBrowserTestBase::GetTabletMode() const {
return false;
}
bool FileManagerBrowserTestBase::GetEnableDriveFs() const {
return false;
}
......
......@@ -38,11 +38,14 @@ class FileManagerBrowserTestBase : public extensions::ExtensionApiTest {
void SetUpInProcessBrowserTestFixture() override;
void SetUpOnMainThread() override;
// Overrides for each FileManagerBrowserTest test extension type.
// Mandatory overrides for each File Manager test extension type.
virtual GuestMode GetGuestMode() const = 0;
virtual const char* GetTestCaseName() const = 0;
virtual std::string GetFullTestCaseName() const = 0;
virtual const char* GetTestExtensionManifestName() const = 0;
// Optional overrides for each File Manager test extension type.
virtual bool GetTabletMode() const;
virtual bool GetEnableDriveFs() const;
virtual bool GetRequiresStartupBrowser() const;
virtual bool GetNeedsZipSupport() const;
......@@ -60,6 +63,9 @@ class FileManagerBrowserTestBase : public extensions::ExtensionApiTest {
// Returns true if the test requires in guest mode.
bool IsGuestModeTest() const { return GetGuestMode() == IN_GUEST_MODE; }
// Returns true if the test runs in tablet mode (aka Ash immersive mode).
bool IsTabletModeTest() const { return GetTabletMode(); }
// Returns true if the test requires DriveFS.
bool IsDriveFsTest() const { return GetEnableDriveFs(); }
......
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