Index: chrome/browser/apps/web_view_browsertest.cc |
diff --git a/chrome/browser/apps/web_view_browsertest.cc b/chrome/browser/apps/web_view_browsertest.cc |
index f905a113a99267a44c985ace843ac64ecec6613b..e380125c08c0d7b739d99c21e1fbe0ca5f7a15e8 100644 |
--- a/chrome/browser/apps/web_view_browsertest.cc |
+++ b/chrome/browser/apps/web_view_browsertest.cc |
@@ -3,6 +3,7 @@ |
// found in the LICENSE file. |
#include "apps/native_app_window.h" |
+#include "base/path_service.h" |
#include "base/strings/stringprintf.h" |
#include "base/strings/utf_string_conversions.h" |
#include "chrome/browser/apps/app_browsertest_util.h" |
@@ -43,6 +44,15 @@ const char kRedirectResponsePath[] = "/server-redirect"; |
const char kRedirectResponseFullPath[] = |
"/extensions/platform_apps/web_view/shim/guest_redirect.html"; |
+// Platform-specific filename relative to the chrome executable. |
+#if defined(OS_WIN) |
+const wchar_t library_name[] = L"ppapi_tests.dll"; |
+#elif defined(OS_MACOSX) |
+const char library_name[] = "ppapi_tests.plugin"; |
+#elif defined(OS_POSIX) |
+const char library_name[] = "libppapi_tests.so"; |
+#endif |
+ |
class EmptyHttpResponse : public net::test_server::HttpResponse { |
public: |
virtual std::string ToResponseString() const OVERRIDE { |
@@ -1765,3 +1775,32 @@ IN_PROC_BROWSER_TEST_F(WebViewTest, Dialog_TestPromptDialog) { |
"DoneDialogTest.FAILED", |
"web_view/dialog"); |
} |
+ |
+#if defined(ENABLE_PLUGINS) |
+class WebViewPluginTest : public WebViewTest { |
+ protected: |
+ virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
+ WebViewTest::SetUpCommandLine(command_line); |
+ |
+ // Append the switch to register the pepper plugin. |
+ // library name = <out dir>/<test_name>.<library_extension> |
+ // MIME type = application/x-ppapi-<test_name> |
+ base::FilePath plugin_dir; |
+ EXPECT_TRUE(PathService::Get(base::DIR_MODULE, &plugin_dir)); |
+ |
+ base::FilePath plugin_lib = plugin_dir.Append(library_name); |
+ EXPECT_TRUE(base::PathExists(plugin_lib)); |
+ base::FilePath::StringType pepper_plugin = plugin_lib.value(); |
+ pepper_plugin.append(FILE_PATH_LITERAL(";application/x-ppapi-tests")); |
+ command_line->AppendSwitchNative(switches::kRegisterPepperPlugins, |
+ pepper_plugin); |
+ } |
+}; |
+ |
+IN_PROC_BROWSER_TEST_F(WebViewPluginTest, TestLoadPluginEvent) { |
+ TestHelper("testPluginLoadPermission", |
+ "DoneShimTest.PASSED", |
+ "DoneShimTest.FAILED", |
+ "web_view/shim"); |
+} |
+#endif // defined(ENABLE_PLUGINS) |