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

Side by Side Diff: ios/web/web_state/navigation_context_impl_unittest.mm

Issue 2759613003: Use SameDocument instead of SamePage term on iOS. (Closed)
Patch Set: Actually fixed tests Created 3 years, 9 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 #include "ios/web/web_state/navigation_context_impl.h" 5 #include "ios/web/web_state/navigation_context_impl.h"
6 6
7 #import "ios/web/public/test/fakes/test_web_state.h" 7 #import "ios/web/public/test/fakes/test_web_state.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "testing/platform_test.h" 9 #include "testing/platform_test.h"
10 10
(...skipping 13 matching lines...) Expand all
24 std::unique_ptr<NavigationContext> context = 24 std::unique_ptr<NavigationContext> context =
25 NavigationContextImpl::CreateNavigationContext(&web_state_, url_); 25 NavigationContextImpl::CreateNavigationContext(&web_state_, url_);
26 ASSERT_TRUE(context); 26 ASSERT_TRUE(context);
27 27
28 EXPECT_EQ(&web_state_, context->GetWebState()); 28 EXPECT_EQ(&web_state_, context->GetWebState());
29 EXPECT_EQ(url_, context->GetUrl()); 29 EXPECT_EQ(url_, context->GetUrl());
30 EXPECT_FALSE(context->IsSameDocument()); 30 EXPECT_FALSE(context->IsSameDocument());
31 EXPECT_FALSE(context->IsErrorPage()); 31 EXPECT_FALSE(context->IsErrorPage());
32 } 32 }
33 33
34 // Tests CreateSamePageNavigationContext factory method. 34 // Tests CreateSameDocumentNavigationContext factory method.
35 TEST_F(NavigationContextImplTest, SamePageNavigationContext) { 35 TEST_F(NavigationContextImplTest, SameDocumentNavigationContext) {
36 std::unique_ptr<NavigationContext> context = 36 std::unique_ptr<NavigationContext> context =
37 NavigationContextImpl::CreateSamePageNavigationContext(&web_state_, url_); 37 NavigationContextImpl::CreateSameDocumentNavigationContext(&web_state_,
38 url_);
38 ASSERT_TRUE(context); 39 ASSERT_TRUE(context);
39 40
40 EXPECT_EQ(&web_state_, context->GetWebState()); 41 EXPECT_EQ(&web_state_, context->GetWebState());
41 EXPECT_EQ(url_, context->GetUrl()); 42 EXPECT_EQ(url_, context->GetUrl());
42 EXPECT_TRUE(context->IsSameDocument()); 43 EXPECT_TRUE(context->IsSameDocument());
43 EXPECT_FALSE(context->IsErrorPage()); 44 EXPECT_FALSE(context->IsErrorPage());
44 } 45 }
45 46
46 // Tests CreateErrorPageNavigationContext factory method. 47 // Tests CreateErrorPageNavigationContext factory method.
47 TEST_F(NavigationContextImplTest, ErrorPageNavigationContext) { 48 TEST_F(NavigationContextImplTest, ErrorPageNavigationContext) {
48 std::unique_ptr<NavigationContext> context = 49 std::unique_ptr<NavigationContext> context =
49 NavigationContextImpl::CreateErrorPageNavigationContext(&web_state_, 50 NavigationContextImpl::CreateErrorPageNavigationContext(&web_state_,
50 url_); 51 url_);
51 ASSERT_TRUE(context); 52 ASSERT_TRUE(context);
52 53
53 EXPECT_EQ(&web_state_, context->GetWebState()); 54 EXPECT_EQ(&web_state_, context->GetWebState());
54 EXPECT_EQ(url_, context->GetUrl()); 55 EXPECT_EQ(url_, context->GetUrl());
55 EXPECT_FALSE(context->IsSameDocument()); 56 EXPECT_FALSE(context->IsSameDocument());
56 EXPECT_TRUE(context->IsErrorPage()); 57 EXPECT_TRUE(context->IsErrorPage());
57 } 58 }
58 59
59 } // namespace web 60 } // namespace web
OLDNEW
« no previous file with comments | « ios/web/web_state/navigation_context_impl.mm ('k') | ios/web/web_state/ui/crw_web_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698