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

Unified Diff: content/browser/web_contents/web_contents_impl_unittest.cc

Issue 14985014: Introduce content::PageState (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comments to the top of page_state.h Created 7 years, 7 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/web_contents/web_contents_impl_unittest.cc
diff --git a/content/browser/web_contents/web_contents_impl_unittest.cc b/content/browser/web_contents/web_contents_impl_unittest.cc
index 1c535acd1cb74155e5fe5b3a2ca5e80fe54f96b8..63ae5f5c2859ac70bf5cc6024f223f959d4f8deb 100644
--- a/content/browser/web_contents/web_contents_impl_unittest.cc
+++ b/content/browser/web_contents/web_contents_impl_unittest.cc
@@ -30,7 +30,6 @@
#include "content/test/test_content_client.h"
#include "content/test/test_web_contents.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "webkit/glue/webkit_glue.h"
namespace content {
namespace {
@@ -1023,7 +1022,7 @@ TEST_F(WebContentsImplTest, CrossSiteNavigationCanceled) {
EXPECT_TRUE(contents()->GetPendingRenderViewHost() == NULL);
}
-// Test that NavigationEntries have the correct content state after going
+// Test that NavigationEntries have the correct page state after going
// forward and back. Prevents regression for bug 1116137.
TEST_F(WebContentsImplTest, NavigationEntryContentState) {
TestRenderViewHost* orig_rvh = test_rvh();
@@ -1034,30 +1033,30 @@ TEST_F(WebContentsImplTest, NavigationEntryContentState) {
NavigationEntry* entry = controller().GetLastCommittedEntry();
EXPECT_TRUE(entry == NULL);
- // Committed entry should have content state after DidNavigate.
+ // Committed entry should have page state after DidNavigate.
contents()->TestDidNavigate(orig_rvh, 1, url, PAGE_TRANSITION_TYPED);
entry = controller().GetLastCommittedEntry();
- EXPECT_FALSE(entry->GetContentState().empty());
+ EXPECT_TRUE(entry->GetPageState().IsValid());
// Navigate to same site.
const GURL url2("http://images.google.com");
controller().LoadURL(url2, Referrer(), PAGE_TRANSITION_TYPED, std::string());
entry = controller().GetLastCommittedEntry();
- EXPECT_FALSE(entry->GetContentState().empty());
+ EXPECT_TRUE(entry->GetPageState().IsValid());
- // Committed entry should have content state after DidNavigate.
+ // Committed entry should have page state after DidNavigate.
contents()->TestDidNavigate(orig_rvh, 2, url2, PAGE_TRANSITION_TYPED);
entry = controller().GetLastCommittedEntry();
- EXPECT_FALSE(entry->GetContentState().empty());
+ EXPECT_TRUE(entry->GetPageState().IsValid());
- // Now go back. Committed entry should still have content state.
+ // Now go back. Committed entry should still have page state.
controller().GoBack();
contents()->TestDidNavigate(orig_rvh, 1, url, PAGE_TRANSITION_TYPED);
entry = controller().GetLastCommittedEntry();
- EXPECT_FALSE(entry->GetContentState().empty());
+ EXPECT_TRUE(entry->GetPageState().IsValid());
}
-// Test that NavigationEntries have the correct content state and SiteInstance
+// Test that NavigationEntries have the correct page state and SiteInstance
// state after opening a new window to about:blank. Prevents regression for
// bugs b/1116137 and http://crbug.com/111975.
TEST_F(WebContentsImplTest, NavigationEntryContentStateNewWindow) {
@@ -1069,9 +1068,9 @@ TEST_F(WebContentsImplTest, NavigationEntryContentStateNewWindow) {
contents()->TestDidNavigate(orig_rvh, 1, url, PAGE_TRANSITION_TYPED);
contents()->TestDidNavigate(orig_rvh, 1, url, PAGE_TRANSITION_TYPED);
- // Should have a content state here.
+ // Should have a page state here.
NavigationEntry* entry = controller().GetLastCommittedEntry();
- EXPECT_FALSE(entry->GetContentState().empty());
+ EXPECT_TRUE(entry->GetPageState().IsValid());
// The SiteInstance should be available for other navigations to use.
NavigationEntryImpl* entry_impl =

Powered by Google App Engine
This is Rietveld 408576698