summaryrefslogtreecommitdiffstats
path: root/webkit/tools/test_shell/plugin_tests.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-02 19:31:19 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-02 19:31:19 +0000
commita3cea22375a8c4d298845c871039a81bbe7fded9 (patch)
treeaa729110d81b3e54ccc8917598e9adf89509c89f /webkit/tools/test_shell/plugin_tests.cc
parent1e465e817ab0d5d7ce776dfbd5e544e5d5aca22a (diff)
downloadchromium_src-a3cea22375a8c4d298845c871039a81bbe7fded9.zip
chromium_src-a3cea22375a8c4d298845c871039a81bbe7fded9.tar.gz
chromium_src-a3cea22375a8c4d298845c871039a81bbe7fded9.tar.bz2
The test was failing because the ui_test run before it failed to delete the test plugin (it must have still been locked by the browser process). As a result, test_shell_tests loaded that plugin into its plugin info cache.
Review URL: http://codereview.chromium.org/58005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13026 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell/plugin_tests.cc')
-rw-r--r--webkit/tools/test_shell/plugin_tests.cc20
1 files changed, 13 insertions, 7 deletions
diff --git a/webkit/tools/test_shell/plugin_tests.cc b/webkit/tools/test_shell/plugin_tests.cc
index 64824e4..d5ac5ca 100644
--- a/webkit/tools/test_shell/plugin_tests.cc
+++ b/webkit/tools/test_shell/plugin_tests.cc
@@ -45,7 +45,7 @@ class PluginTest : public TestShellTest {
};
// Tests navigator.plugins.refresh() works.
-TEST_F(PluginTest, DISABLED_Refresh) {
+TEST_F(PluginTest, Refresh) {
std::string html = "\
<div id='result'>Test running....</div>\
<script>\
@@ -65,17 +65,23 @@ TEST_F(PluginTest, DISABLED_Refresh) {
</script>\
";
- DeleteTestPlugin(); // Remove any leftover from previous tests if they exist.
- test_shell_->webView()->GetMainFrame()->LoadHTMLString(
- html, GURL("about:blank"));
- test_shell_->WaitTestFinished();
-
- std::wstring text;
WebScriptSource call_check(
WebString::fromUTF8("check();"));
WebScriptSource refresh(
WebString::fromUTF8("navigator.plugins.refresh(false)"));
+ // Remove any leftover from previous tests if they exist. We must also
+ // refresh WebKit's plugin cache since it might have had an entry for the
+ // test plugin from a previous test.
+ DeleteTestPlugin();
+ ASSERT_FALSE(file_util::PathExists(plugin_file_path_));
+ test_shell_->webView()->GetMainFrame()->ExecuteScript(refresh);
+
+ test_shell_->webView()->GetMainFrame()->LoadHTMLString(
+ html, GURL("about:blank"));
+ test_shell_->WaitTestFinished();
+
+ std::wstring text;
test_shell_->webView()->GetMainFrame()->ExecuteScript(call_check);
test_shell_->webView()->GetMainFrame()->GetContentAsPlainText(10000, &text);
ASSERT_EQ(text, L"FAIL");