#include "base/strings/stringprintf.h"
#include "build/build_config.h"
#include "chrome/common/webui_url_constants.h"
#include "chrome/test/base/web_ui_mocha_browser_test.h"
#include "content/public/test/browser_test.h"
class PrintPreviewFocusTest : public WebUIMochaFocusTest { … };
#if BUILDFLAG(IS_WIN)
#define MAYBE_FocusPrintButtonOnReady …
#else
#define MAYBE_FocusPrintButtonOnReady …
#endif
IN_PROC_BROWSER_TEST_F(PrintPreviewFocusTest, MAYBE_FocusPrintButtonOnReady) { … }
IN_PROC_BROWSER_TEST_F(PrintPreviewFocusTest, BlurResetsEmptyNumberInput) { … }
#if BUILDFLAG(IS_WIN)
#define MAYBE_AutoFocusScalingInput …
#else
#define MAYBE_AutoFocusScalingInput …
#endif
IN_PROC_BROWSER_TEST_F(PrintPreviewFocusTest, MAYBE_AutoFocusScalingInput) { … }
class PrintPreviewPagesSettingsFocusTest : public PrintPreviewFocusTest { … };
IN_PROC_BROWSER_TEST_F(PrintPreviewPagesSettingsFocusTest, ClearInput) { … }
IN_PROC_BROWSER_TEST_F(PrintPreviewPagesSettingsFocusTest,
InputNotDisabledOnValidityChange) { … }
IN_PROC_BROWSER_TEST_F(PrintPreviewPagesSettingsFocusTest,
EnterOnInputTriggersPrint) { … }
#if BUILDFLAG(IS_CHROMEOS)
class PrintPreviewDestinationDropdownCrosFocusTest
: public PrintPreviewFocusTest {
protected:
void RunTestCase(const std::string& testCase) {
PrintPreviewFocusTest::RunTest(
"print_preview/destination_dropdown_cros_test.js",
base::StringPrintf("runMochaTest('DestinationDropdownCrosTest', '%s');",
testCase.c_str()));
}
};
IN_PROC_BROWSER_TEST_F(PrintPreviewDestinationDropdownCrosFocusTest,
ClickCloses) {
RunTestCase("ClickCloses");
}
#endif
class PrintPreviewDestinationDialogFocusTest : public PrintPreviewFocusTest { … };
IN_PROC_BROWSER_TEST_F(PrintPreviewDestinationDialogFocusTest, FocusSearchBox) { … }
IN_PROC_BROWSER_TEST_F(PrintPreviewDestinationDialogFocusTest,
EscapeSearchBox) { … }