Commit db77f760 authored by rbpotter's avatar rbpotter Committed by Commit Bot

PDFViewerUpdate: Only run tests for new elements with update flag on

There is no value to running these tests with the PDFViewerUpdate flag
disabled, as they are unit tests for elements not used in the old UI.

Bug: 1120279
Change-Id: I55ae870f749f8737ab4076c59fbb8619856243c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2391763Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804115}
parent 57f73fd3
...@@ -848,9 +848,7 @@ class PDFExtensionJSUpdatesDisabledTest : public PDFExtensionJSTestBase { ...@@ -848,9 +848,7 @@ class PDFExtensionJSUpdatesDisabledTest : public PDFExtensionJSTestBase {
~PDFExtensionJSUpdatesDisabledTest() override = default; ~PDFExtensionJSUpdatesDisabledTest() override = default;
protected: protected:
const std::vector<base::Feature> GetDisabledFeatures() const override { bool ShouldEnablePDFViewerUpdate() const override { return false; }
return {chrome_pdf::features::kPDFViewerUpdate};
}
}; };
// Zoom toolbar doesn't exist and the top toolbar is sticky with the new PDF // Zoom toolbar doesn't exist and the top toolbar is sticky with the new PDF
...@@ -859,6 +857,34 @@ IN_PROC_BROWSER_TEST_F(PDFExtensionJSUpdatesDisabledTest, ToolbarManager) { ...@@ -859,6 +857,34 @@ IN_PROC_BROWSER_TEST_F(PDFExtensionJSUpdatesDisabledTest, ToolbarManager) {
RunTestsInJsModule("toolbar_manager_test.js", "test.pdf"); RunTestsInJsModule("toolbar_manager_test.js", "test.pdf");
} }
class PDFExtensionJSUpdatesEnabledTest : public PDFExtensionJSTestBase {
public:
~PDFExtensionJSUpdatesEnabledTest() override = default;
protected:
bool ShouldEnablePDFViewerUpdate() const override { return true; }
};
// The following tests verify behavior of elements that are only used when the
// PDFViewerUpdate flag is enabled.
IN_PROC_BROWSER_TEST_F(PDFExtensionJSUpdatesEnabledTest, ViewerPdfToolbarNew) {
// Although this test file does not require a PDF to be loaded, loading the
// elements without loading a PDF is difficult.
RunTestsInJsModule("viewer_pdf_toolbar_new_test.js", "test.pdf");
}
IN_PROC_BROWSER_TEST_F(PDFExtensionJSUpdatesEnabledTest, ViewerPdfSidenav) {
// Although this test file does not require a PDF to be loaded, loading the
// elements without loading a PDF is difficult.
RunTestsInJsModule("viewer_pdf_sidenav_test.js", "test.pdf");
}
IN_PROC_BROWSER_TEST_F(PDFExtensionJSUpdatesEnabledTest, ViewerThumbnailBar) {
// Although this test file does not require a PDF to be loaded, loading the
// elements without loading a PDF is difficult.
RunTestsInJsModule("viewer_thumbnail_bar_test.js", "test.pdf");
}
class PDFExtensionJSTest : public PDFExtensionJSTestBase, class PDFExtensionJSTest : public PDFExtensionJSTestBase,
public testing::WithParamInterface<bool> { public testing::WithParamInterface<bool> {
public: public:
...@@ -927,24 +953,6 @@ IN_PROC_BROWSER_TEST_P(PDFExtensionJSTest, DownloadControls) { ...@@ -927,24 +953,6 @@ IN_PROC_BROWSER_TEST_P(PDFExtensionJSTest, DownloadControls) {
RunTestsInJsModule("download_controls_test.js", "test.pdf"); RunTestsInJsModule("download_controls_test.js", "test.pdf");
} }
IN_PROC_BROWSER_TEST_P(PDFExtensionJSTest, ViewerPdfToolbarNew) {
// Although this test file does not require a PDF to be loaded, loading the
// elements without loading a PDF is difficult.
RunTestsInJsModule("viewer_pdf_toolbar_new_test.js", "test.pdf");
}
IN_PROC_BROWSER_TEST_P(PDFExtensionJSTest, ViewerPdfSidenav) {
// Although this test file does not require a PDF to be loaded, loading the
// elements without loading a PDF is difficult.
RunTestsInJsModule("viewer_pdf_sidenav_test.js", "test.pdf");
}
IN_PROC_BROWSER_TEST_P(PDFExtensionJSTest, ViewerThumbnailBar) {
// Although this test file does not require a PDF to be loaded, loading the
// elements without loading a PDF is difficult.
RunTestsInJsModule("viewer_thumbnail_bar_test.js", "test.pdf");
}
IN_PROC_BROWSER_TEST_P(PDFExtensionJSTest, Title) { IN_PROC_BROWSER_TEST_P(PDFExtensionJSTest, Title) {
RunTestsInJsModule("title_test.js", "test-title.pdf"); RunTestsInJsModule("title_test.js", "test-title.pdf");
} }
......
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