Index: chrome/browser/content_settings/content_settings_browsertest.cc |
diff --git a/chrome/browser/content_settings/content_settings_browsertest.cc b/chrome/browser/content_settings/content_settings_browsertest.cc |
index beeb83147513181a4dc2db9e282de76befd2749e..91e0c66a5dc01b092b4d34b381b8481c47dcaaae 100644 |
--- a/chrome/browser/content_settings/content_settings_browsertest.cc |
+++ b/chrome/browser/content_settings/content_settings_browsertest.cc |
@@ -421,10 +421,14 @@ IN_PROC_BROWSER_TEST_F(ClickToPlayPluginTest, NoCallbackAtLoad) { |
GURL url("data:application/vnd.npapi-test,CallOnStartup();"); |
ui_test_utils::NavigateToURL(browser(), url); |
+ std::string script("CallOnStartup = function() { "); |
+ script.append("document.documentElement.appendChild"); |
+ script.append("(document.createElement(\"head\")); "); |
+ script.append("document.title = \"OK\"; }"); |
+ |
// Inject the callback function into the HTML page generated by the browser. |
ASSERT_TRUE(content::ExecuteScript( |
- browser()->tab_strip_model()->GetActiveWebContents(), |
- "CallOnStartup = function() { document.title = \"OK\"; }")); |
+ browser()->tab_strip_model()->GetActiveWebContents(), script)); |
base::string16 expected_title(base::ASCIIToUTF16("OK")); |
content::TitleWatcher title_watcher( |