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

Side by Side Diff: ios/web/navigation/crw_session_entry_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 unified diff | Download patch
« no previous file with comments | « ios/web/navigation/crw_session_entry.mm ('k') | ios/web/navigation/navigation_item_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 #import "ios/web/navigation/crw_session_entry.h" 5 #import "ios/web/navigation/crw_session_entry.h"
6 6
7 #import <Foundation/Foundation.h> 7 #import <Foundation/Foundation.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 23 matching lines...) Expand all
34 CRWSessionEntry* entry2, 34 CRWSessionEntry* entry2,
35 ui::PageTransition transition); 35 ui::PageTransition transition);
36 36
37 protected: 37 protected:
38 void SetUp() override { 38 void SetUp() override {
39 GURL url("http://init.test"); 39 GURL url("http://init.test");
40 ui::PageTransition transition = 40 ui::PageTransition transition =
41 ui::PAGE_TRANSITION_AUTO_BOOKMARK; 41 ui::PAGE_TRANSITION_AUTO_BOOKMARK;
42 std::unique_ptr<web::NavigationItemImpl> item( 42 std::unique_ptr<web::NavigationItemImpl> item(
43 new web::NavigationItemImpl()); 43 new web::NavigationItemImpl());
44 item->SetOriginalRequestURL(url);
44 item->SetURL(url); 45 item->SetURL(url);
45 item->SetTransitionType(transition); 46 item->SetTransitionType(transition);
46 item->SetTimestamp(base::Time::Now()); 47 item->SetTimestamp(base::Time::Now());
47 item->SetPostData([@"Test data" dataUsingEncoding:NSUTF8StringEncoding]); 48 item->SetPostData([@"Test data" dataUsingEncoding:NSUTF8StringEncoding]);
48 sessionEntry_.reset( 49 sessionEntry_.reset(
49 [[CRWSessionEntry alloc] initWithNavigationItem:std::move(item)]); 50 [[CRWSessionEntry alloc] initWithNavigationItem:std::move(item)]);
50 } 51 }
51 void TearDown() override { sessionEntry_.reset(); } 52 void TearDown() override { sessionEntry_.reset(); }
52 53
53 protected: 54 protected:
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 TEST_F(CRWSessionEntryTest, NonEmptyVirtualUrl) { 330 TEST_F(CRWSessionEntryTest, NonEmptyVirtualUrl) {
330 web::NavigationItem* item = [sessionEntry_ navigationItem]; 331 web::NavigationItem* item = [sessionEntry_ navigationItem];
331 item->SetVirtualURL(GURL("http://user.friendly")); 332 item->SetVirtualURL(GURL("http://user.friendly"));
332 EXPECT_EQ(GURL("http://user.friendly/"), item->GetVirtualURL()); 333 EXPECT_EQ(GURL("http://user.friendly/"), item->GetVirtualURL());
333 EXPECT_EQ(GURL("http://init.test/"), item->GetURL()); 334 EXPECT_EQ(GURL("http://init.test/"), item->GetURL());
334 } 335 }
335 336
336 TEST_F(CRWSessionEntryTest, EmptyDescription) { 337 TEST_F(CRWSessionEntryTest, EmptyDescription) {
337 EXPECT_GT([[sessionEntry_ description] length], 0U); 338 EXPECT_GT([[sessionEntry_ description] length], 0U);
338 } 339 }
OLDNEW
« no previous file with comments | « ios/web/navigation/crw_session_entry.mm ('k') | ios/web/navigation/navigation_item_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698