| 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 "base/base_paths.h" | 5 #include "base/base_paths.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "chrome/browser/extensions/component_loader.h" | 8 #include "chrome/browser/extensions/component_loader.h" |
| 9 #include "chrome/browser/extensions/extension_apitest.h" | 9 #include "chrome/browser/extensions/extension_apitest.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 ExtensionApiTest::SetUpCommandLine(command_line); | 24 ExtensionApiTest::SetUpCommandLine(command_line); |
| 25 command_line->AppendSwitch(switches::kOutOfProcessPdf); | 25 command_line->AppendSwitch(switches::kOutOfProcessPdf); |
| 26 } | 26 } |
| 27 | 27 |
| 28 virtual void SetUpOnMainThread() OVERRIDE { | 28 virtual void SetUpOnMainThread() OVERRIDE { |
| 29 ExtensionApiTest::SetUpOnMainThread(); | 29 ExtensionApiTest::SetUpOnMainThread(); |
| 30 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 30 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 31 } | 31 } |
| 32 | 32 |
| 33 | 33 |
| 34 virtual void CleanUpOnMainThread() OVERRIDE { | 34 virtual void TearDownOnMainThread() OVERRIDE { |
| 35 ASSERT_TRUE(embedded_test_server()->ShutdownAndWaitUntilComplete()); | 35 ASSERT_TRUE(embedded_test_server()->ShutdownAndWaitUntilComplete()); |
| 36 ExtensionApiTest::CleanUpOnMainThread(); | 36 ExtensionApiTest::TearDownOnMainThread(); |
| 37 } | 37 } |
| 38 | 38 |
| 39 void RunTestsInFile(std::string filename, bool requiresPlugin) { | 39 void RunTestsInFile(std::string filename, bool requiresPlugin) { |
| 40 base::FilePath pdf_plugin_src; | 40 base::FilePath pdf_plugin_src; |
| 41 PathService::Get(base::DIR_SOURCE_ROOT, &pdf_plugin_src); | 41 PathService::Get(base::DIR_SOURCE_ROOT, &pdf_plugin_src); |
| 42 pdf_plugin_src = pdf_plugin_src.AppendASCII("pdf"); | 42 pdf_plugin_src = pdf_plugin_src.AppendASCII("pdf"); |
| 43 if (requiresPlugin && !base::DirectoryExists(pdf_plugin_src)) { | 43 if (requiresPlugin && !base::DirectoryExists(pdf_plugin_src)) { |
| 44 LOG(WARNING) << "Not running " << filename << | 44 LOG(WARNING) << "Not running " << filename << |
| 45 " because it requires the PDF plugin which is not available."; | 45 " because it requires the PDF plugin which is not available."; |
| 46 return; | 46 return; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 RunTestsInFile("basic_test.js", false); | 85 RunTestsInFile("basic_test.js", false); |
| 86 } | 86 } |
| 87 | 87 |
| 88 IN_PROC_BROWSER_TEST_F(PDFExtensionTest, BasicPlugin) { | 88 IN_PROC_BROWSER_TEST_F(PDFExtensionTest, BasicPlugin) { |
| 89 RunTestsInFile("basic_plugin_test.js", true); | 89 RunTestsInFile("basic_plugin_test.js", true); |
| 90 } | 90 } |
| 91 | 91 |
| 92 IN_PROC_BROWSER_TEST_F(PDFExtensionTest, Viewport) { | 92 IN_PROC_BROWSER_TEST_F(PDFExtensionTest, Viewport) { |
| 93 RunTestsInFile("viewport_test.js", false); | 93 RunTestsInFile("viewport_test.js", false); |
| 94 } | 94 } |
| OLD | NEW |