summaryrefslogtreecommitdiffstats
path: root/webkit/tools
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/tools')
-rw-r--r--webkit/tools/test_shell/plugin_tests.cc28
-rwxr-xr-xwebkit/tools/test_shell/test_shell.cc10
2 files changed, 37 insertions, 1 deletions
diff --git a/webkit/tools/test_shell/plugin_tests.cc b/webkit/tools/test_shell/plugin_tests.cc
index d5ac5ca..f2ad349 100644
--- a/webkit/tools/test_shell/plugin_tests.cc
+++ b/webkit/tools/test_shell/plugin_tests.cc
@@ -95,3 +95,31 @@ TEST_F(PluginTest, Refresh) {
DeleteTestPlugin();
}
+
+TEST_F(PluginTest, DefaultPluginLoadTest) {
+ std::string html = "\
+ <div id='result'>Test running....</div>\
+ <script>\
+ function onSuccess() {\
+ var result = document.getElementById('result');\
+ result.innerHTML = 'DONE';\
+ }\
+ </script>\
+ <DIV ID=PluginDiv>\
+ <object classid=\"clsid:9E8BC6CE-AF35-400c-ABF6-A3F746A1871D\">\
+ <embed type=\"application/chromium-test-default-plugin\"\
+ mode=\"np_embed\"\
+ ></embed>\
+ </object>\
+ </DIV>\
+ ";
+
+ test_shell_->webView()->GetMainFrame()->LoadHTMLString(
+ html, GURL("about:blank"));
+ test_shell_->WaitTestFinished();
+
+ std::wstring text;
+ test_shell_->webView()->GetMainFrame()->GetContentAsPlainText(10000, &text);
+
+ ASSERT_EQ(true, StartsWith(text, L"DONE", true));
+}
diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc
index 6ce2509..3e8af04 100755
--- a/webkit/tools/test_shell/test_shell.cc
+++ b/webkit/tools/test_shell/test_shell.cc
@@ -7,7 +7,7 @@
#include "webkit/tools/test_shell/test_shell.h"
-
+#include "base/base_paths.h"
#include "base/command_line.h"
#include "base/debug_on_start.h"
#include "base/file_path.h"
@@ -614,6 +614,14 @@ bool GetPluginFinderURL(std::string* plugin_finder_url) {
#if !defined(LINUX2)
bool IsDefaultPluginEnabled() {
+ FilePath exe_path;
+
+ if (PathService::Get(base::FILE_EXE, &exe_path)) {
+ std::wstring exe_name = file_util::GetFilenameFromPath(
+ exe_path.ToWStringHack());
+ if (StartsWith(exe_name, L"test_shell_tests", false))
+ return true;
+ }
return false;
}