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

Unified Diff: ios/web/web_state/navigation_context_impl_unittest.mm

Issue 2901633002: Replaced NavigationContext::IsErrorPage with NavigationContext::GetError (Closed)
Patch Set: Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/navigation_context_impl_unittest.mm
diff --git a/ios/web/web_state/navigation_context_impl_unittest.mm b/ios/web/web_state/navigation_context_impl_unittest.mm
index b58770a06b7a8d9dc2f8a7c5510b86be8aef5f38..7566deb038f42a0880c3885c501fb572103cb518 100644
--- a/ios/web/web_state/navigation_context_impl_unittest.mm
+++ b/ios/web/web_state/navigation_context_impl_unittest.mm
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ios/web/web_state/navigation_context_impl.h"
+#import "ios/web/web_state/navigation_context_impl.h"
#import "ios/web/public/test/fakes/test_web_state.h"
#include "net/http/http_response_headers.h"
@@ -39,7 +39,7 @@ TEST_F(NavigationContextImplTest, NavigationContext) {
EXPECT_EQ(&web_state_, context->GetWebState());
EXPECT_EQ(url_, context->GetUrl());
EXPECT_FALSE(context->IsSameDocument());
- EXPECT_FALSE(context->IsErrorPage());
+ EXPECT_FALSE(context->GetError());
EXPECT_FALSE(context->GetResponseHeaders());
}
@@ -50,25 +50,26 @@ TEST_F(NavigationContextImplTest, Setters) {
ASSERT_TRUE(context);
ASSERT_FALSE(context->IsSameDocument());
- ASSERT_FALSE(context->IsErrorPage());
+ ASSERT_FALSE(context->GetError());
ASSERT_NE(response_headers_.get(), context->GetResponseHeaders());
// SetSameDocument
context->SetIsSameDocument(true);
EXPECT_TRUE(context->IsSameDocument());
- EXPECT_FALSE(context->IsErrorPage());
+ EXPECT_FALSE(context->GetError());
EXPECT_NE(response_headers_.get(), context->GetResponseHeaders());
// SetErrorPage
- context->SetIsErrorPage(true);
+ NSError* error = [[[NSError alloc] init] autorelease];
+ context->SetError(error);
EXPECT_TRUE(context->IsSameDocument());
- EXPECT_TRUE(context->IsErrorPage());
+ EXPECT_EQ(error, context->GetError());
EXPECT_NE(response_headers_.get(), context->GetResponseHeaders());
// SetResponseHeaders
context->SetResponseHeaders(response_headers_);
EXPECT_TRUE(context->IsSameDocument());
- EXPECT_TRUE(context->IsErrorPage());
+ EXPECT_EQ(error, context->GetError());
EXPECT_EQ(response_headers_.get(), context->GetResponseHeaders());
}
« 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