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

Side by Side 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, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/guestview/webview/plugin_permission_helper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 1702 matching lines...) Expand 10 before | Expand all | Expand 10 after
1758 "DoneDialogTest.FAILED", 1768 "DoneDialogTest.FAILED",
1759 "web_view/dialog"); 1769 "web_view/dialog");
1760 } 1770 }
1761 1771
1762 IN_PROC_BROWSER_TEST_F(WebViewTest, Dialog_TestPromptDialog) { 1772 IN_PROC_BROWSER_TEST_F(WebViewTest, Dialog_TestPromptDialog) {
1763 TestHelper("testPromptDialog", 1773 TestHelper("testPromptDialog",
1764 "DoneDialogTest.PASSED", 1774 "DoneDialogTest.PASSED",
1765 "DoneDialogTest.FAILED", 1775 "DoneDialogTest.FAILED",
1766 "web_view/dialog"); 1776 "web_view/dialog");
1767 } 1777 }
1778
1779 #if defined(ENABLE_PLUGINS)
1780 class WebViewPluginTest : public WebViewTest {
1781 protected:
1782 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
1783 WebViewTest::SetUpCommandLine(command_line);
1784
1785 // Append the switch to register the pepper plugin.
1786 // library name = <out dir>/<test_name>.<library_extension>
1787 // MIME type = application/x-ppapi-<test_name>
1788 base::FilePath plugin_dir;
1789 EXPECT_TRUE(PathService::Get(base::DIR_MODULE, &plugin_dir));
1790
1791 base::FilePath plugin_lib = plugin_dir.Append(library_name);
1792 EXPECT_TRUE(base::PathExists(plugin_lib));
1793 base::FilePath::StringType pepper_plugin = plugin_lib.value();
1794 pepper_plugin.append(FILE_PATH_LITERAL(";application/x-ppapi-tests"));
1795 command_line->AppendSwitchNative(switches::kRegisterPepperPlugins,
1796 pepper_plugin);
1797 }
1798 };
1799
1800 IN_PROC_BROWSER_TEST_F(WebViewPluginTest, TestLoadPluginEvent) {
1801 TestHelper("testPluginLoadPermission",
1802 "DoneShimTest.PASSED",
1803 "DoneShimTest.FAILED",
1804 "web_view/shim");
1805 }
1806 #endif // defined(ENABLE_PLUGINS)
OLDNEW
« 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