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

Unified Diff: android_webview/native/state_serializer_unittests.cc

Issue 101573003: Add the navigation redirect-chain to Sync sessions proto for offline analysis. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix android unit test (state_serializer_unittests.cc). Created 6 years, 11 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
Index: android_webview/native/state_serializer_unittests.cc
diff --git a/android_webview/native/state_serializer_unittests.cc b/android_webview/native/state_serializer_unittests.cc
index 02179521f83e5984dc35a1ec18d3fe7c9800a3fd..5649145b2ef65ad4b33a760130e5990c1ef43fb0 100644
--- a/android_webview/native/state_serializer_unittests.cc
+++ b/android_webview/native/state_serializer_unittests.cc
@@ -55,6 +55,8 @@ TEST(AndroidWebViewStateSerializerTest, TestNavigationEntrySerialization) {
const bool is_overriding_user_agent = true;
const base::Time timestamp = base::Time::FromInternalValue(12345);
const int http_status_code = 404;
+ const GURL redirect_0("http://redirect_0");
+ const GURL redirect_1("http://redirect_1");
entry->SetURL(url);
entry->SetVirtualURL(virtual_url);
@@ -67,6 +69,11 @@ TEST(AndroidWebViewStateSerializerTest, TestNavigationEntrySerialization) {
entry->SetIsOverridingUserAgent(is_overriding_user_agent);
entry->SetTimestamp(timestamp);
entry->SetHttpStatusCode(http_status_code);
+ std::vector<GURL> redirects;
+ redirects.push_back(redirect_0);
+ redirects.push_back(redirect_1);
+ redirects.push_back(virtual_url);
+ entry->SetRedirectChain(redirects);
Pickle pickle;
bool result = internal::WriteNavigationEntryToPickle(*entry, &pickle);
@@ -89,6 +96,10 @@ TEST(AndroidWebViewStateSerializerTest, TestNavigationEntrySerialization) {
EXPECT_EQ(is_overriding_user_agent, copy->GetIsOverridingUserAgent());
EXPECT_EQ(timestamp, copy->GetTimestamp());
EXPECT_EQ(http_status_code, copy->GetHttpStatusCode());
+ EXPECT_EQ(3U, copy->GetRedirectChain().size());
+ EXPECT_EQ(redirect_0, copy->GetRedirectChain().at(0));
+ EXPECT_EQ(redirect_1, copy->GetRedirectChain().at(1));
+ EXPECT_EQ(virtual_url, copy->GetRedirectChain().at(2));
}
} // namespace android_webview

Powered by Google App Engine
This is Rietveld 408576698