| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
| 8 #include "base/files/file_enumerator.h" | 8 #include "base/files/file_enumerator.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/hash.h" | 10 #include "base/hash.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 public testing::WithParamInterface<int> { | 66 public testing::WithParamInterface<int> { |
| 67 public: | 67 public: |
| 68 ~PDFExtensionTest() override {} | 68 ~PDFExtensionTest() override {} |
| 69 | 69 |
| 70 void SetUpCommandLine(base::CommandLine* command_line) override { | 70 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 71 command_line->AppendSwitch(switches::kDisablePdfMaterialUI); | 71 command_line->AppendSwitch(switches::kDisablePdfMaterialUI); |
| 72 } | 72 } |
| 73 | 73 |
| 74 void SetUpOnMainThread() override { | 74 void SetUpOnMainThread() override { |
| 75 ExtensionApiTest::SetUpOnMainThread(); | 75 ExtensionApiTest::SetUpOnMainThread(); |
| 76 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 76 ASSERT_TRUE(embedded_test_server()->Start()); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void TearDownOnMainThread() override { | 79 void TearDownOnMainThread() override { |
| 80 ASSERT_TRUE(embedded_test_server()->ShutdownAndWaitUntilComplete()); | 80 ASSERT_TRUE(embedded_test_server()->ShutdownAndWaitUntilComplete()); |
| 81 ExtensionApiTest::TearDownOnMainThread(); | 81 ExtensionApiTest::TearDownOnMainThread(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 bool PdfIsExpectedToFailLoad(const std::string& pdf_file) { | 84 bool PdfIsExpectedToFailLoad(const std::string& pdf_file) { |
| 85 const char* const kFailingPdfs[] = { | 85 const char* const kFailingPdfs[] = { |
| 86 // TODO(thestig): Investigate why this file doesn't fail when served by | 86 // TODO(thestig): Investigate why this file doesn't fail when served by |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 RunTestsInFile("title_test.js", "test-title.pdf"); | 551 RunTestsInFile("title_test.js", "test-title.pdf"); |
| 552 } | 552 } |
| 553 | 553 |
| 554 IN_PROC_BROWSER_TEST_F(MaterialPDFExtensionTest, WhitespaceTitle) { | 554 IN_PROC_BROWSER_TEST_F(MaterialPDFExtensionTest, WhitespaceTitle) { |
| 555 RunTestsInFile("whitespace_title_test.js", "test-whitespace-title.pdf"); | 555 RunTestsInFile("whitespace_title_test.js", "test-whitespace-title.pdf"); |
| 556 } | 556 } |
| 557 | 557 |
| 558 IN_PROC_BROWSER_TEST_F(MaterialPDFExtensionTest, PageChange) { | 558 IN_PROC_BROWSER_TEST_F(MaterialPDFExtensionTest, PageChange) { |
| 559 RunTestsInFile("page_change_test.js", "test-bookmarks.pdf"); | 559 RunTestsInFile("page_change_test.js", "test-bookmarks.pdf"); |
| 560 } | 560 } |
| OLD | NEW |