summaryrefslogtreecommitdiffstats
path: root/content/browser
diff options
context:
space:
mode:
authorfsamuel@chromium.org <fsamuel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-26 06:03:40 +0000
committerfsamuel@chromium.org <fsamuel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-26 06:03:40 +0000
commit6bfc220cd4df1577ebae83bf421134222d80b7bf (patch)
treec6e2b54143e9ed98e43924141111ac0b304d0c1b /content/browser
parent122503f1d53450ad9065b907333ce84cf8706bb2 (diff)
downloadchromium_src-6bfc220cd4df1577ebae83bf421134222d80b7bf.zip
chromium_src-6bfc220cd4df1577ebae83bf421134222d80b7bf.tar.gz
chromium_src-6bfc220cd4df1577ebae83bf421134222d80b7bf.tar.bz2
<webview>: Move back, forward, canGoBack, canGoForward, go from content to chrome
BUG=166165 Test=WebViewTest.Navigation Review URL: https://chromiumcodereview.appspot.com/17447005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208642 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser')
-rw-r--r--content/browser/browser_plugin/browser_plugin_guest.cc4
-rw-r--r--content/browser/browser_plugin/browser_plugin_host_browsertest.cc139
2 files changed, 0 insertions, 143 deletions
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc
index a1ac547..b9ebda6 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -916,10 +916,6 @@ void BrowserPluginGuest::DidCommitProvisionalLoadForFrame(
BrowserPluginMsg_LoadCommit_Params params;
params.url = url;
params.is_top_level = is_main_frame;
- params.current_entry_index =
- GetWebContents()->GetController().GetCurrentEntryIndex();
- params.entry_count =
- GetWebContents()->GetController().GetEntryCount();
SendMessageToEmbedder(
new BrowserPluginMsg_LoadCommit(instance_id(), params));
RecordAction(UserMetricsAction("BrowserPlugin.Guest.DidNavigate"));
diff --git a/content/browser/browser_plugin/browser_plugin_host_browsertest.cc b/content/browser/browser_plugin/browser_plugin_host_browsertest.cc
index 134705e..7b78d9b 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());