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

Side by Side Diff: content/browser/frame_host/navigation_entry_impl_unittest.cc

Issue 2225343002: Navigation: move RestoreType and ReloadType into a separate file (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: [rebase] Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/strings/string16.h" 5 #include "base/strings/string16.h"
6 #include "base/strings/string_util.h" 6 #include "base/strings/string_util.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "content/browser/frame_host/navigation_entry_impl.h" 10 #include "content/browser/frame_host/navigation_entry_impl.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 entry2_->set_is_renderer_initiated(true); 201 entry2_->set_is_renderer_initiated(true);
202 EXPECT_TRUE(entry2_->is_renderer_initiated()); 202 EXPECT_TRUE(entry2_->is_renderer_initiated());
203 203
204 // Post Data 204 // Post Data
205 EXPECT_FALSE(entry1_->GetHasPostData()); 205 EXPECT_FALSE(entry1_->GetHasPostData());
206 EXPECT_FALSE(entry2_->GetHasPostData()); 206 EXPECT_FALSE(entry2_->GetHasPostData());
207 entry2_->SetHasPostData(true); 207 entry2_->SetHasPostData(true);
208 EXPECT_TRUE(entry2_->GetHasPostData()); 208 EXPECT_TRUE(entry2_->GetHasPostData());
209 209
210 // Restored 210 // Restored
211 EXPECT_EQ(NavigationEntryImpl::RESTORE_NONE, entry1_->restore_type()); 211 EXPECT_EQ(RestoreType::NONE, entry1_->restore_type());
212 EXPECT_FALSE(entry1_->IsRestored()); 212 EXPECT_FALSE(entry1_->IsRestored());
213 EXPECT_EQ(NavigationEntryImpl::RESTORE_NONE, entry2_->restore_type()); 213 EXPECT_EQ(RestoreType::NONE, entry2_->restore_type());
214 EXPECT_FALSE(entry2_->IsRestored()); 214 EXPECT_FALSE(entry2_->IsRestored());
215 entry2_->set_restore_type( 215 entry2_->set_restore_type(RestoreType::LAST_SESSION_EXITED_CLEANLY);
216 NavigationEntryImpl::RESTORE_LAST_SESSION_EXITED_CLEANLY); 216 EXPECT_EQ(RestoreType::LAST_SESSION_EXITED_CLEANLY, entry2_->restore_type());
217 EXPECT_EQ(NavigationEntryImpl::RESTORE_LAST_SESSION_EXITED_CLEANLY,
218 entry2_->restore_type());
219 EXPECT_TRUE(entry2_->IsRestored()); 217 EXPECT_TRUE(entry2_->IsRestored());
220 218
221 // Original URL 219 // Original URL
222 EXPECT_EQ(GURL(), entry1_->GetOriginalRequestURL()); 220 EXPECT_EQ(GURL(), entry1_->GetOriginalRequestURL());
223 EXPECT_EQ(GURL(), entry2_->GetOriginalRequestURL()); 221 EXPECT_EQ(GURL(), entry2_->GetOriginalRequestURL());
224 entry2_->SetOriginalRequestURL(GURL("original_url")); 222 entry2_->SetOriginalRequestURL(GURL("original_url"));
225 EXPECT_EQ(GURL("original_url"), entry2_->GetOriginalRequestURL()); 223 EXPECT_EQ(GURL("original_url"), entry2_->GetOriginalRequestURL());
226 224
227 // User agent override 225 // User agent override
228 EXPECT_FALSE(entry1_->GetIsOverridingUserAgent()); 226 EXPECT_FALSE(entry1_->GetIsOverridingUserAgent());
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 // Content in |output| is not modified if data is not present at the key. 284 // Content in |output| is not modified if data is not present at the key.
287 EXPECT_FALSE(entry1_->GetExtraData("search_terms", &output)); 285 EXPECT_FALSE(entry1_->GetExtraData("search_terms", &output));
288 EXPECT_EQ(test_data, output); 286 EXPECT_EQ(test_data, output);
289 // Using an empty string shows that the data is not present in the map. 287 // Using an empty string shows that the data is not present in the map.
290 base::string16 output2; 288 base::string16 output2;
291 EXPECT_FALSE(entry1_->GetExtraData("search_terms", &output2)); 289 EXPECT_FALSE(entry1_->GetExtraData("search_terms", &output2));
292 EXPECT_EQ(ASCIIToUTF16(""), output2); 290 EXPECT_EQ(ASCIIToUTF16(""), output2);
293 } 291 }
294 292
295 } // namespace content 293 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigation_entry_impl.cc ('k') | content/browser/frame_host/navigation_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698