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

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

Issue 11092023: Browser Plugin: Implement CanGoBack/CanGoForward (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated Navigation Event 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 28ab5b1fa0f31994a83b17081990ecaad16f0529..862a5d01fd60bf66aa1e09929c380e137eda868a 100644
--- a/content/browser/browser_plugin/browser_plugin_host_browsertest.cc
+++ b/content/browser/browser_plugin/browser_plugin_host_browsertest.cc
@@ -543,6 +543,19 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, Renavigate) {
string16 actual_title = title_watcher.WaitAndGetTitle();
EXPECT_EQ(expected_title, actual_title);
+
+ base::Value* value =
+ rvh->ExecuteJavascriptAndGetValue(string16(),
+ ASCIIToUTF16("CanGoBack()"));
+ bool result = false;
+ ASSERT_TRUE(value->GetAsBoolean(&result));
+ EXPECT_TRUE(result);
+
+ value = rvh->ExecuteJavascriptAndGetValue(string16(),
+ ASCIIToUTF16("CanGoForward()"));
+ result = false;
+ ASSERT_TRUE(value->GetAsBoolean(&result));
+ EXPECT_TRUE(result);
}
// Go forward and verify that we're back at P3.
@@ -551,6 +564,12 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, Renavigate) {
content::TitleWatcher title_watcher(test_guest()->web_contents(),
expected_title);
+ base::Value* value =
+ rvh->ExecuteJavascriptAndGetValue(string16(),
+ ASCIIToUTF16("CanGoForward()"));
+ bool result = false;
+ ASSERT_TRUE(value->GetAsBoolean(&result));
+ EXPECT_TRUE(result);
Charlie Reis 2012/10/11 19:03:01 Please move this after the Forward() call and have
rvh->ExecuteJavascriptAndGetValue(string16(), ASCIIToUTF16("Forward();"));
string16 actual_title = title_watcher.WaitAndGetTitle();
@@ -567,6 +586,13 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, Renavigate) {
string16 actual_title = title_watcher.WaitAndGetTitle();
EXPECT_EQ(expected_title, actual_title);
+
+ base::Value* value =
+ rvh->ExecuteJavascriptAndGetValue(string16(),
+ ASCIIToUTF16("CanGoBack()"));
+ bool result = true;
+ ASSERT_TRUE(value->GetAsBoolean(&result));
+ EXPECT_FALSE(result);
}
}
« 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