ClickToPlayPluginTest.NoCallbackAtLoad test should create head element

SPEC: http://www.whatwg.org/specs/web-apps/current-work/#document.title

According to spec, set title without head element should be aborted in steps.
So to continue test as well as follow spec, NoCallbackAtLoad test case
should create head element before setting title.

Review URL: https://codereview.chromium.org/400523004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283773 0039d316-1c4b-4281-b951-d872f2087c98
parent 53d84ae8
...@@ -421,10 +421,14 @@ IN_PROC_BROWSER_TEST_F(ClickToPlayPluginTest, NoCallbackAtLoad) { ...@@ -421,10 +421,14 @@ IN_PROC_BROWSER_TEST_F(ClickToPlayPluginTest, NoCallbackAtLoad) {
GURL url("data:application/vnd.npapi-test,CallOnStartup();"); GURL url("data:application/vnd.npapi-test,CallOnStartup();");
ui_test_utils::NavigateToURL(browser(), url); 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. // Inject the callback function into the HTML page generated by the browser.
ASSERT_TRUE(content::ExecuteScript( ASSERT_TRUE(content::ExecuteScript(
browser()->tab_strip_model()->GetActiveWebContents(), browser()->tab_strip_model()->GetActiveWebContents(), script));
"CallOnStartup = function() { document.title = \"OK\"; }"));
base::string16 expected_title(base::ASCIIToUTF16("OK")); base::string16 expected_title(base::ASCIIToUTF16("OK"));
content::TitleWatcher title_watcher( content::TitleWatcher title_watcher(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment