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

Unified Diff: chrome/browser/content_settings/content_settings_browsertest.cc

Issue 400523004: ClickToPlayPluginTest.NoCallbackAtLoad test should create head element (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698