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

Unified Diff: ios/web/navigation/navigation_item_impl_unittest.mm

Issue 2578173005: Add GetOriginalRequestURL() to NavigationItem interface. (Closed)
Patch Set: fix callers Created 3 years, 11 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 | « ios/web/navigation/navigation_item_impl.mm ('k') | ios/web/public/navigation_item.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/navigation/navigation_item_impl_unittest.mm
diff --git a/ios/web/navigation/navigation_item_impl_unittest.mm b/ios/web/navigation/navigation_item_impl_unittest.mm
index 642ff00a26c437fc95ff926a6c41d190d681f7f9..b5e08ebe7975e604fb8ac643d9580b499c4ad720 100644
--- a/ios/web/navigation/navigation_item_impl_unittest.mm
+++ b/ios/web/navigation/navigation_item_impl_unittest.mm
@@ -16,6 +16,7 @@
namespace web {
namespace {
+const char kItemURLString[] = "http://init.test";
static NSString* const kHTTPHeaderKey1 = @"key1";
static NSString* const kHTTPHeaderKey2 = @"key2";
static NSString* const kHTTPHeaderValue1 = @"value1";
@@ -25,7 +26,8 @@
protected:
void SetUp() override {
item_.reset(new web::NavigationItemImpl());
- item_->SetURL(GURL("http://init.test"));
+ item_->SetOriginalRequestURL(GURL(kItemURLString));
+ item_->SetURL(GURL(kItemURLString));
item_->SetTransitionType(ui::PAGE_TRANSITION_AUTO_BOOKMARK);
item_->SetTimestamp(base::Time::Now());
item_->AddHttpRequestHeaders(@{kHTTPHeaderKey1 : kHTTPHeaderValue1});
@@ -109,5 +111,16 @@ void SetUp() override {
EXPECT_FALSE(item_->GetHttpRequestHeaders());
}
+// Tests the getter, setter, and copy constructor for the original request URL.
+TEST_F(NavigationItemTest, OriginalURL) {
+ GURL original_url = GURL(kItemURLString);
+ EXPECT_EQ(original_url, item_->GetOriginalRequestURL());
+ web::NavigationItemImpl copy(*item_);
+ GURL new_url = GURL("http://new_url.test");
+ item_->SetOriginalRequestURL(new_url);
+ EXPECT_EQ(new_url, item_->GetOriginalRequestURL());
+ EXPECT_EQ(original_url, copy.GetOriginalRequestURL());
+}
+
} // namespace
} // namespace web
« no previous file with comments | « ios/web/navigation/navigation_item_impl.mm ('k') | ios/web/public/navigation_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698