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

Unified Diff: ios/web/web_state/ui/crw_wk_navigation_states_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/ui/crw_wk_navigation_states.mm ('k') | ios/web/web_state/web_state_impl.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/ui/crw_wk_navigation_states_unittest.mm
diff --git a/ios/web/web_state/ui/crw_wk_navigation_states_unittest.mm b/ios/web/web_state/ui/crw_wk_navigation_states_unittest.mm
index 83d31f8a569ad35efc4cb207931d986cb36ab001..600b692d800ea9c185379d400a395be8e47ded8e 100644
--- a/ios/web/web_state/ui/crw_wk_navigation_states_unittest.mm
+++ b/ios/web/web_state/ui/crw_wk_navigation_states_unittest.mm
@@ -7,7 +7,7 @@
#import <WebKit/WebKit.h>
#import "base/mac/scoped_nsobject.h"
-#include "ios/web/web_state/navigation_context_impl.h"
+#import "ios/web/web_state/navigation_context_impl.h"
#include "net/http/http_response_headers.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
@@ -94,13 +94,14 @@ TEST_F(CRWWKNavigationStatesTest, Context) {
EXPECT_EQ(GURL(kTestUrl1),
[states_ contextForNavigation:navigation1_]->GetUrl());
EXPECT_TRUE([states_ contextForNavigation:navigation1_]->IsSameDocument());
- EXPECT_FALSE([states_ contextForNavigation:navigation1_]->IsErrorPage());
+ EXPECT_FALSE([states_ contextForNavigation:navigation1_]->GetError());
// Replace existing context.
std::unique_ptr<web::NavigationContextImpl> context2 =
NavigationContextImpl::CreateNavigationContext(nullptr /*web_state*/,
GURL(kTestUrl2));
- context2->SetIsErrorPage(true);
+ NSError* error = [[[NSError alloc] init] autorelease];
+ context2->SetError(error);
[states_ setContext:std::move(context2) forNavigation:navigation1_];
EXPECT_FALSE([states_ contextForNavigation:navigation2_]);
EXPECT_FALSE([states_ contextForNavigation:navigation3_]);
@@ -108,7 +109,7 @@ TEST_F(CRWWKNavigationStatesTest, Context) {
EXPECT_EQ(GURL(kTestUrl2),
[states_ contextForNavigation:navigation1_]->GetUrl());
EXPECT_FALSE([states_ contextForNavigation:navigation1_]->IsSameDocument());
- EXPECT_TRUE([states_ contextForNavigation:navigation1_]->IsErrorPage());
+ EXPECT_EQ(error, [states_ contextForNavigation:navigation1_]->GetError());
}
// Tests null WKNavigation object.
« no previous file with comments | « ios/web/web_state/ui/crw_wk_navigation_states.mm ('k') | ios/web/web_state/web_state_impl.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698