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

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

Issue 17447005: <webview>: Move back, forward, canGoBack, canGoForward, go from content to chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@filter_listener
Patch Set: Created 7 years, 6 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
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 134705eeede78c083d091f5407b8348557349e5c..7b78d9bb6cc3ea323f071e9cb79eda6ac5dd81f2 100644
--- a/content/browser/browser_plugin/browser_plugin_host_browsertest.cc
+++ b/content/browser/browser_plugin/browser_plugin_host_browsertest.cc
@@ -620,100 +620,6 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, AcceptTouchEvents) {
EXPECT_FALSE(rvh->has_touch_handler());
}
-IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, Renavigate) {
- const char kEmbedderURL[] = "/browser_plugin_embedder.html";
- StartBrowserPluginTest(
- kEmbedderURL, GetHTMLForGuestWithTitle("P1"), true, std::string());
- RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
- test_embedder()->web_contents()->GetRenderViewHost());
-
- // Navigate to P2 and verify that the navigation occurred.
- {
- const string16 expected_title = ASCIIToUTF16("P2");
- content::TitleWatcher title_watcher(test_guest()->web_contents(),
- expected_title);
-
- ExecuteSyncJSFunction(
- rvh,
- base::StringPrintf(
- "SetSrc('%s');", GetHTMLForGuestWithTitle("P2").c_str()));
-
- string16 actual_title = title_watcher.WaitAndGetTitle();
- EXPECT_EQ(expected_title, actual_title);
- }
-
- // Navigate to P3 and verify that the navigation occurred.
- {
- const string16 expected_title = ASCIIToUTF16("P3");
- content::TitleWatcher title_watcher(test_guest()->web_contents(),
- expected_title);
-
- ExecuteSyncJSFunction(
- rvh,
- base::StringPrintf(
- "SetSrc('%s');", GetHTMLForGuestWithTitle("P3").c_str()));
-
- string16 actual_title = title_watcher.WaitAndGetTitle();
- EXPECT_EQ(expected_title, actual_title);
- }
-
- // Go back and verify that we're back at P2.
- {
- const string16 expected_title = ASCIIToUTF16("P2");
- content::TitleWatcher title_watcher(test_guest()->web_contents(),
- expected_title);
-
- ExecuteSyncJSFunction(rvh, "Back();");
- string16 actual_title = title_watcher.WaitAndGetTitle();
- EXPECT_EQ(expected_title, actual_title);
-
- scoped_ptr<base::Value> value =
- content::ExecuteScriptAndGetValue(rvh, "CanGoBack()");
- bool result = false;
- ASSERT_TRUE(value->GetAsBoolean(&result));
- EXPECT_TRUE(result);
-
- value = content::ExecuteScriptAndGetValue(rvh, "CanGoForward()");
- result = false;
- ASSERT_TRUE(value->GetAsBoolean(&result));
- EXPECT_TRUE(result);
- }
-
- // Go forward and verify that we're back at P3.
- {
- const string16 expected_title = ASCIIToUTF16("P3");
- content::TitleWatcher title_watcher(test_guest()->web_contents(),
- expected_title);
-
- ExecuteSyncJSFunction(rvh, "Forward();");
- string16 actual_title = title_watcher.WaitAndGetTitle();
- EXPECT_EQ(expected_title, actual_title);
-
- scoped_ptr<base::Value> value =
- content::ExecuteScriptAndGetValue(rvh, "CanGoForward()");
- bool result = true;
- ASSERT_TRUE(value->GetAsBoolean(&result));
- EXPECT_FALSE(result);
- }
-
- // Go back two entries and verify that we're back at P1.
- {
- const string16 expected_title = ASCIIToUTF16("P1");
- content::TitleWatcher title_watcher(test_guest()->web_contents(),
- expected_title);
-
- ExecuteSyncJSFunction(rvh, "Go(-2);");
- string16 actual_title = title_watcher.WaitAndGetTitle();
- EXPECT_EQ(expected_title, actual_title);
-
- scoped_ptr<base::Value> value =
- content::ExecuteScriptAndGetValue(rvh, "CanGoBack()");
- bool result = true;
- ASSERT_TRUE(value->GetAsBoolean(&result));
- EXPECT_FALSE(result);
- }
-}
-
// This tests verifies that reloading the embedder does not crash the browser
// and that the guest is reset.
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, ReloadEmbedder) {
@@ -779,51 +685,6 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, TerminateGuest) {
test_guest()->WaitForExit();
}
-// This test verifies that the guest is responsive after crashing and going back
-// to a previous navigation entry.
-IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, BackAfterTerminateGuest) {
- const char* kEmbedderURL = "/browser_plugin_embedder.html";
- StartBrowserPluginTest(
- kEmbedderURL, GetHTMLForGuestWithTitle("P1"), true, std::string());
- RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
- test_embedder()->web_contents()->GetRenderViewHost());
-
- // Navigate to P2 and verify that the navigation occurred.
- {
- const string16 expected_title = ASCIIToUTF16("P2");
- content::TitleWatcher title_watcher(test_guest()->web_contents(),
- expected_title);
-
- ExecuteSyncJSFunction(
- rvh,
- base::StringPrintf(
- "SetSrc('%s');", GetHTMLForGuestWithTitle("P2").c_str()));
-
- string16 actual_title = title_watcher.WaitAndGetTitle();
- EXPECT_EQ(expected_title, actual_title);
- }
- // Kill the guest.
- ExecuteSyncJSFunction(rvh, "document.getElementById('plugin').terminate()");
-
- // Expect the guest to report that it crashed.
- test_guest()->WaitForExit();
- // Go back and verify that we're back at P1.
- {
- const string16 expected_title = ASCIIToUTF16("P1");
- content::TitleWatcher title_watcher(test_guest()->web_contents(),
- expected_title);
-
- ExecuteSyncJSFunction(rvh, "Back();");
-
- string16 actual_title = title_watcher.WaitAndGetTitle();
- EXPECT_EQ(expected_title, actual_title);
- }
- // Send an input event and verify that the guest receives the input.
- SimulateMouseClick(test_embedder()->web_contents(), 0,
- WebKit::WebMouseEvent::ButtonLeft);
- test_guest()->WaitForInput();
-}
-
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadStart) {
const char kEmbedderURL[] = "/browser_plugin_embedder.html";
StartBrowserPluginTest(kEmbedderURL, "about:blank", true, std::string());
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_guest.cc ('k') | content/common/browser_plugin/browser_plugin_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698