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

Side by Side Diff: chrome/browser/tab_contents/navigation_entry_unittest.cc

Issue 4194007: Revert "Refactor automation messages." due to mysterious problems on mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/string16.h" 5 #include "base/string16.h"
6 #include "base/string_util.h" 6 #include "base/string_util.h"
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/renderer_host/site_instance.h" 8 #include "chrome/browser/renderer_host/site_instance.h"
9 #include "chrome/browser/tab_contents/navigation_entry.h" 9 #include "chrome/browser/tab_contents/navigation_entry.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 127
128 // Test other basic accessors 128 // Test other basic accessors
129 TEST_F(NavigationEntryTest, NavigationEntryAccessors) { 129 TEST_F(NavigationEntryTest, NavigationEntryAccessors) {
130 // SiteInstance 130 // SiteInstance
131 EXPECT_TRUE(entry1_.get()->site_instance() == NULL); 131 EXPECT_TRUE(entry1_.get()->site_instance() == NULL);
132 EXPECT_EQ(instance_, entry2_.get()->site_instance()); 132 EXPECT_EQ(instance_, entry2_.get()->site_instance());
133 entry1_.get()->set_site_instance(instance_); 133 entry1_.get()->set_site_instance(instance_);
134 EXPECT_EQ(instance_, entry1_.get()->site_instance()); 134 EXPECT_EQ(instance_, entry1_.get()->site_instance());
135 135
136 // Page type 136 // Page type
137 EXPECT_EQ(NORMAL_PAGE, entry1_.get()->page_type()); 137 EXPECT_EQ(NavigationEntry::NORMAL_PAGE, entry1_.get()->page_type());
138 EXPECT_EQ(NORMAL_PAGE, entry2_.get()->page_type()); 138 EXPECT_EQ(NavigationEntry::NORMAL_PAGE, entry2_.get()->page_type());
139 entry2_.get()->set_page_type(INTERSTITIAL_PAGE); 139 entry2_.get()->set_page_type(NavigationEntry::INTERSTITIAL_PAGE);
140 EXPECT_EQ(INTERSTITIAL_PAGE, entry2_.get()->page_type()); 140 EXPECT_EQ(NavigationEntry::INTERSTITIAL_PAGE, entry2_.get()->page_type());
141 141
142 // Referrer 142 // Referrer
143 EXPECT_EQ(GURL(), entry1_.get()->referrer()); 143 EXPECT_EQ(GURL(), entry1_.get()->referrer());
144 EXPECT_EQ(GURL("from"), entry2_.get()->referrer()); 144 EXPECT_EQ(GURL("from"), entry2_.get()->referrer());
145 entry2_.get()->set_referrer(GURL("from2")); 145 entry2_.get()->set_referrer(GURL("from2"));
146 EXPECT_EQ(GURL("from2"), entry2_.get()->referrer()); 146 EXPECT_EQ(GURL("from2"), entry2_.get()->referrer());
147 147
148 // Title 148 // Title
149 EXPECT_EQ(string16(), entry1_.get()->title()); 149 EXPECT_EQ(string16(), entry1_.get()->title());
150 EXPECT_EQ(ASCIIToUTF16("title"), entry2_.get()->title()); 150 EXPECT_EQ(ASCIIToUTF16("title"), entry2_.get()->title());
(...skipping 23 matching lines...) Expand all
174 EXPECT_FALSE(entry2_.get()->has_post_data()); 174 EXPECT_FALSE(entry2_.get()->has_post_data());
175 entry2_.get()->set_has_post_data(true); 175 entry2_.get()->set_has_post_data(true);
176 EXPECT_TRUE(entry2_.get()->has_post_data()); 176 EXPECT_TRUE(entry2_.get()->has_post_data());
177 177
178 // Restored 178 // Restored
179 EXPECT_EQ(NavigationEntry::RESTORE_NONE, entry1_->restore_type()); 179 EXPECT_EQ(NavigationEntry::RESTORE_NONE, entry1_->restore_type());
180 EXPECT_EQ(NavigationEntry::RESTORE_NONE, entry2_->restore_type()); 180 EXPECT_EQ(NavigationEntry::RESTORE_NONE, entry2_->restore_type());
181 entry2_->set_restore_type(NavigationEntry::RESTORE_LAST_SESSION); 181 entry2_->set_restore_type(NavigationEntry::RESTORE_LAST_SESSION);
182 EXPECT_EQ(NavigationEntry::RESTORE_LAST_SESSION, entry2_->restore_type()); 182 EXPECT_EQ(NavigationEntry::RESTORE_LAST_SESSION, entry2_->restore_type());
183 } 183 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/navigation_entry.h ('k') | chrome/browser/tab_contents/security_style.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698