OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |