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

Side by Side Diff: ios/web/navigation/crw_session_entry_unittest.mm

Issue 1861593005: Convert //ios from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase? Created 4 years, 8 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 21 matching lines...) Expand all
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
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 }
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