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

Unified Diff: content/browser/android/web_contents_observer_android.cc

Issue 281563002: [Android WebView] Filter out error page URL from onPageFinished to un-flake tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Filter out the error page URL on the side of AwContentsClient Created 6 years, 6 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: content/browser/android/web_contents_observer_android.cc
diff --git a/content/browser/android/web_contents_observer_android.cc b/content/browser/android/web_contents_observer_android.cc
index 19a622a3829ab564abdefb4e2e8bfe5f70975ccc..108600773fa27e98a019d692759af298b51c64d2 100644
--- a/content/browser/android/web_contents_observer_android.cc
+++ b/content/browser/android/web_contents_observer_android.cc
@@ -16,6 +16,7 @@
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/navigation_entry.h"
+#include "content/public/common/url_constants.h"
#include "jni/WebContentsObserverAndroid_jni.h"
using base::android::AttachCurrentThread;
@@ -215,6 +216,7 @@ void WebContentsObserverAndroid::DidFinishLoad(
return;
std::string url_string = validated_url.spec();
+ bool is_error_page = content::kUnreachableWebDataURL == url_string;
NavigationEntry* entry =
web_contents()->GetController().GetLastCommittedEntry();
// Note that GetBaseURLForDataURL is only used by the Android WebView.
@@ -223,8 +225,12 @@ void WebContentsObserverAndroid::DidFinishLoad(
ScopedJavaLocalRef<jstring> jstring_url(
ConvertUTF8ToJavaString(env, url_string));
- Java_WebContentsObserverAndroid_didFinishLoad(
- env, obj.obj(), frame_id, jstring_url.obj(), is_main_frame);
+ Java_WebContentsObserverAndroid_didFinishLoad(env,
+ obj.obj(),
+ frame_id,
+ jstring_url.obj(),
+ is_main_frame,
+ is_error_page);
}
void WebContentsObserverAndroid::NavigationEntryCommitted(

Powered by Google App Engine
This is Rietveld 408576698