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

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: Fixed AwContentsTest#testEscapingOfErrorPage 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 344a901149df9eb25345e788a54f8abb995be300..6295be50a14bfc13a9d3598204131233d7a2d040 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));
bulach 2014/06/17 00:42:12 hmm.... I'm not quite sure about the approach here
mnaganov (inactive) 2014/06/17 09:52:15 Yes, sounds reasonable. Sorry for not making that
- 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::DocumentLoadedInFrame(

Powered by Google App Engine
This is Rietveld 408576698