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

Unified Diff: content/browser/browser_plugin/browser_plugin_host_browsertest.cc

Issue 11035067: Add loadCommit and loadStop Event (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ShimSrcAttribute Test Created 8 years, 2 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 | « content/browser/browser_plugin/browser_plugin_guest.cc ('k') | content/common/browser_plugin_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_plugin/browser_plugin_host_browsertest.cc
diff --git a/content/browser/browser_plugin/browser_plugin_host_browsertest.cc b/content/browser/browser_plugin/browser_plugin_host_browsertest.cc
index c40bfde33ddb80c31d254fe62a955348936bd633..a0366f18240a2652b4a16c10202f4739f1092439 100644
--- a/content/browser/browser_plugin/browser_plugin_host_browsertest.cc
+++ b/content/browser/browser_plugin/browser_plugin_host_browsertest.cc
@@ -922,4 +922,44 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, DISABLED_PostMessageToIFrame) {
}
}
+IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadStop) {
+ const char* kEmbedderURL = "files/browser_plugin_embedder.html";
+ StartBrowserPluginTest(kEmbedderURL, "about:blank", true, "");
+
+ const string16 expected_title = ASCIIToUTF16("loadStop");
+ content::TitleWatcher title_watcher(
+ test_embedder()->web_contents(), expected_title);
+ // Renavigate the guest to |kHTMLForGuest|.
+ RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
+ test_embedder()->web_contents()->GetRenderViewHost());
+ ExecuteSyncJSFunction(rvh, ASCIIToUTF16(
+ StringPrintf("SetSrc('%s');", kHTMLForGuest)));
+
+ string16 actual_title = title_watcher.WaitAndGetTitle();
+ EXPECT_EQ(expected_title, actual_title);
+}
+
+IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadCommit) {
+ const char* kEmbedderURL = "files/browser_plugin_embedder.html";
+ StartBrowserPluginTest(kEmbedderURL, "about:blank", true, "");
+
+ const string16 expected_title = ASCIIToUTF16(
+ StringPrintf("loadCommit:%s", kHTMLForGuest));
+ content::TitleWatcher title_watcher(
+ test_embedder()->web_contents(), expected_title);
+ // Renavigate the guest to |kHTMLForGuest|.
+ RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
+ test_embedder()->web_contents()->GetRenderViewHost());
+ ExecuteSyncJSFunction(rvh, ASCIIToUTF16(
+ StringPrintf("SetSrc('%s');", kHTMLForGuest)));
+
+ string16 actual_title = title_watcher.WaitAndGetTitle();
+ EXPECT_EQ(expected_title, actual_title);
+ scoped_ptr<base::Value> is_top_level(rvh->ExecuteJavascriptAndGetValue(
+ string16(), ASCIIToUTF16("commitIsTopLevel")));
+ bool top_level_bool = false;
+ EXPECT_TRUE(is_top_level->GetAsBoolean(&top_level_bool));
+ EXPECT_EQ(true, top_level_bool);
+}
+
} // namespace content
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_guest.cc ('k') | content/common/browser_plugin_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698