Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(208)

Unified Diff: chrome/browser/apps/web_view_browsertest.cc

Issue 24576003: <webview>: Change how plugin load works inside guests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/guestview/webview/plugin_permission_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « no previous file | chrome/browser/guestview/webview/plugin_permission_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698