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 21 matching lines...) Expand all Loading... |
32 public: | 32 public: |
33 static void expectEqualSessionEntries(CRWSessionEntry* entry1, | 33 static void expectEqualSessionEntries(CRWSessionEntry* entry1, |
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 scoped_ptr<web::NavigationItemImpl> item(new web::NavigationItemImpl()); | 42 std::unique_ptr<web::NavigationItemImpl> item( |
| 43 new web::NavigationItemImpl()); |
43 item->SetURL(url); | 44 item->SetURL(url); |
44 item->SetTransitionType(transition); | 45 item->SetTransitionType(transition); |
45 item->SetTimestamp(base::Time::Now()); | 46 item->SetTimestamp(base::Time::Now()); |
46 item->SetPostData([@"Test data" dataUsingEncoding:NSUTF8StringEncoding]); | 47 item->SetPostData([@"Test data" dataUsingEncoding:NSUTF8StringEncoding]); |
47 sessionEntry_.reset( | 48 sessionEntry_.reset( |
48 [[CRWSessionEntry alloc] initWithNavigationItem:std::move(item)]); | 49 [[CRWSessionEntry alloc] initWithNavigationItem:std::move(item)]); |
49 } | 50 } |
50 void TearDown() override { sessionEntry_.reset(); } | 51 void TearDown() override { sessionEntry_.reset(); } |
51 | 52 |
52 protected: | 53 protected: |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 TEST_F(CRWSessionEntryTest, NonEmptyVirtualUrl) { | 328 TEST_F(CRWSessionEntryTest, NonEmptyVirtualUrl) { |
328 web::NavigationItem* item = [sessionEntry_ navigationItem]; | 329 web::NavigationItem* item = [sessionEntry_ navigationItem]; |
329 item->SetVirtualURL(GURL("http://user.friendly")); | 330 item->SetVirtualURL(GURL("http://user.friendly")); |
330 EXPECT_EQ(GURL("http://user.friendly/"), item->GetVirtualURL()); | 331 EXPECT_EQ(GURL("http://user.friendly/"), item->GetVirtualURL()); |
331 EXPECT_EQ(GURL("http://init.test/"), item->GetURL()); | 332 EXPECT_EQ(GURL("http://init.test/"), item->GetURL()); |
332 } | 333 } |
333 | 334 |
334 TEST_F(CRWSessionEntryTest, EmptyDescription) { | 335 TEST_F(CRWSessionEntryTest, EmptyDescription) { |
335 EXPECT_GT([[sessionEntry_ description] length], 0U); | 336 EXPECT_GT([[sessionEntry_ description] length], 0U); |
336 } | 337 } |
OLD | NEW |