| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "apps/native_app_window.h" | 5 #include "apps/native_app_window.h" |
| 6 #include "base/path_service.h" |
| 6 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 7 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/apps/app_browsertest_util.h" | 9 #include "chrome/browser/apps/app_browsertest_util.h" |
| 9 #include "chrome/browser/automation/automation_util.h" | 10 #include "chrome/browser/automation/automation_util.h" |
| 10 #include "chrome/browser/extensions/extension_test_message_listener.h" | 11 #include "chrome/browser/extensions/extension_test_message_listener.h" |
| 11 #include "chrome/browser/prerender/prerender_link_manager.h" | 12 #include "chrome/browser/prerender/prerender_link_manager.h" |
| 12 #include "chrome/browser/prerender/prerender_link_manager_factory.h" | 13 #include "chrome/browser/prerender/prerender_link_manager_factory.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
| 15 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 16 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 36 | 37 |
| 37 using prerender::PrerenderLinkManager; | 38 using prerender::PrerenderLinkManager; |
| 38 using prerender::PrerenderLinkManagerFactory; | 39 using prerender::PrerenderLinkManagerFactory; |
| 39 | 40 |
| 40 namespace { | 41 namespace { |
| 41 const char kEmptyResponsePath[] = "/close-socket"; | 42 const char kEmptyResponsePath[] = "/close-socket"; |
| 42 const char kRedirectResponsePath[] = "/server-redirect"; | 43 const char kRedirectResponsePath[] = "/server-redirect"; |
| 43 const char kRedirectResponseFullPath[] = | 44 const char kRedirectResponseFullPath[] = |
| 44 "/extensions/platform_apps/web_view/shim/guest_redirect.html"; | 45 "/extensions/platform_apps/web_view/shim/guest_redirect.html"; |
| 45 | 46 |
| 47 // Platform-specific filename relative to the chrome executable. |
| 48 #if defined(OS_WIN) |
| 49 const wchar_t library_name[] = L"ppapi_tests.dll"; |
| 50 #elif defined(OS_MACOSX) |
| 51 const char library_name[] = "ppapi_tests.plugin"; |
| 52 #elif defined(OS_POSIX) |
| 53 const char library_name[] = "libppapi_tests.so"; |
| 54 #endif |
| 55 |
| 46 class EmptyHttpResponse : public net::test_server::HttpResponse { | 56 class EmptyHttpResponse : public net::test_server::HttpResponse { |
| 47 public: | 57 public: |
| 48 virtual std::string ToResponseString() const OVERRIDE { | 58 virtual std::string ToResponseString() const OVERRIDE { |
| 49 return std::string(); | 59 return std::string(); |
| 50 } | 60 } |
| 51 }; | 61 }; |
| 52 | 62 |
| 53 class TestInterstitialPageDelegate : public content::InterstitialPageDelegate { | 63 class TestInterstitialPageDelegate : public content::InterstitialPageDelegate { |
| 54 public: | 64 public: |
| 55 TestInterstitialPageDelegate() { | 65 TestInterstitialPageDelegate() { |
| (...skipping 1720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1776 "DoneDialogTest.FAILED", | 1786 "DoneDialogTest.FAILED", |
| 1777 "web_view/dialog"); | 1787 "web_view/dialog"); |
| 1778 } | 1788 } |
| 1779 | 1789 |
| 1780 IN_PROC_BROWSER_TEST_F(WebViewTest, Dialog_TestPromptDialog) { | 1790 IN_PROC_BROWSER_TEST_F(WebViewTest, Dialog_TestPromptDialog) { |
| 1781 TestHelper("testPromptDialog", | 1791 TestHelper("testPromptDialog", |
| 1782 "DoneDialogTest.PASSED", | 1792 "DoneDialogTest.PASSED", |
| 1783 "DoneDialogTest.FAILED", | 1793 "DoneDialogTest.FAILED", |
| 1784 "web_view/dialog"); | 1794 "web_view/dialog"); |
| 1785 } | 1795 } |
| 1796 |
| 1797 #if defined(ENABLE_PLUGINS) |
| 1798 class WebViewPluginTest : public WebViewTest { |
| 1799 protected: |
| 1800 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 1801 WebViewTest::SetUpCommandLine(command_line); |
| 1802 |
| 1803 // Append the switch to register the pepper plugin. |
| 1804 // library name = <out dir>/<test_name>.<library_extension> |
| 1805 // MIME type = application/x-ppapi-<test_name> |
| 1806 base::FilePath plugin_dir; |
| 1807 EXPECT_TRUE(PathService::Get(base::DIR_MODULE, &plugin_dir)); |
| 1808 |
| 1809 base::FilePath plugin_lib = plugin_dir.Append(library_name); |
| 1810 EXPECT_TRUE(base::PathExists(plugin_lib)); |
| 1811 base::FilePath::StringType pepper_plugin = plugin_lib.value(); |
| 1812 pepper_plugin.append(FILE_PATH_LITERAL(";application/x-ppapi-tests")); |
| 1813 command_line->AppendSwitchNative(switches::kRegisterPepperPlugins, |
| 1814 pepper_plugin); |
| 1815 } |
| 1816 }; |
| 1817 |
| 1818 IN_PROC_BROWSER_TEST_F(WebViewPluginTest, TestLoadPluginEvent) { |
| 1819 TestHelper("testPluginLoadPermission", |
| 1820 "DoneShimTest.PASSED", |
| 1821 "DoneShimTest.FAILED", |
| 1822 "web_view/shim"); |
| 1823 } |
| 1824 #endif // defined(ENABLE_PLUGINS) |
| OLD | NEW |