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 <Foundation/Foundation.h> | 5 #import <Foundation/Foundation.h> |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #import "base/mac/scoped_nsobject.h" | 8 #import "base/mac/scoped_nsobject.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 protected: | 44 protected: |
45 void SetUp() override { | 45 void SetUp() override { |
46 session_controller_.reset( | 46 session_controller_.reset( |
47 [[CRWSessionController alloc] initWithWindowName:@"test window" | 47 [[CRWSessionController alloc] initWithWindowName:@"test window" |
48 openerId:@"opener" | 48 openerId:@"opener" |
49 openedByDOM:NO | 49 openedByDOM:NO |
50 openerNavigationIndex:0 | 50 openerNavigationIndex:0 |
51 browserState:&browser_state_]); | 51 browserState:&browser_state_]); |
52 } | 52 } |
53 | 53 |
54 web::Referrer MakeReferrer(std::string url) { | 54 web::Referrer MakeReferrer(const std::string& url) { |
55 return web::Referrer(GURL(url), web::ReferrerPolicyDefault); | 55 return web::Referrer(GURL(url), web::ReferrerPolicyDefault); |
56 } | 56 } |
57 | 57 |
58 web::TestWebThreadBundle thread_bundle_; | 58 web::TestWebThreadBundle thread_bundle_; |
59 web::TestBrowserState browser_state_; | 59 web::TestBrowserState browser_state_; |
60 base::scoped_nsobject<CRWSessionController> session_controller_; | 60 base::scoped_nsobject<CRWSessionController> session_controller_; |
61 }; | 61 }; |
62 | 62 |
63 TEST_F(CRWSessionControllerTest, InitWithWindowName) { | 63 TEST_F(CRWSessionControllerTest, InitWithWindowName) { |
64 EXPECT_NSEQ(@"test window", [session_controller_ windowName]); | 64 EXPECT_NSEQ(@"test window", [session_controller_ windowName]); |
(...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1023 | 1023 |
1024 // Remove an entry and attempt to go it. Ensure it outlives the removal. | 1024 // Remove an entry and attempt to go it. Ensure it outlives the removal. |
1025 base::scoped_nsobject<CRWSessionEntry> entry3( | 1025 base::scoped_nsobject<CRWSessionEntry> entry3( |
1026 [[session_controller_.get().entries objectAtIndex:3] retain]); | 1026 [[session_controller_.get().entries objectAtIndex:3] retain]); |
1027 [session_controller_ removeEntryAtIndex:3]; | 1027 [session_controller_ removeEntryAtIndex:3]; |
1028 [session_controller_ goToEntry:entry3]; | 1028 [session_controller_ goToEntry:entry3]; |
1029 EXPECT_EQ(1, session_controller_.get().currentNavigationIndex); | 1029 EXPECT_EQ(1, session_controller_.get().currentNavigationIndex); |
1030 } | 1030 } |
1031 | 1031 |
1032 } // anonymous namespace | 1032 } // anonymous namespace |
OLD | NEW |