|
|
Created:
5 years, 3 months ago by Nate Chapin Modified:
4 years, 4 months ago CC:
blink-reviews Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionDocumentLoader::isCommittedButEmpty is timing-dependent.
It's possible for it to be checked after the DocumentLoader has finished, at
which point it will incorrectly return false.
BUG=520389, 331745
TEST=DocumentLoaderTest.isCommittedButEmpty
Committed: https://crrev.com/dbb678baafd71e3af774d34cbac20b860b8f674e
Cr-Commit-Position: refs/heads/master@{#408277}
Patch Set 1 #Patch Set 2 : Drop the enum value #Patch Set 3 : #Patch Set 4 : Potential fix for android failures #Patch Set 5 : another android experiment #Patch Set 6 : Trybot debugging is the best #Patch Set 7 : #Patch Set 8 : #Patch Set 9 : #Patch Set 10 : #Patch Set 11 : #Patch Set 12 : Rebase (8 months late) #Patch Set 13 : Experiment #Patch Set 14 : another #Patch Set 15 : Sigh. #Patch Set 16 : Emulate net::ERR_ABORTED when replacing empty error page. #Patch Set 17 : moar fix #Patch Set 18 : Make test change #Patch Set 19 : One other idea #Patch Set 20 : fix compile #Patch Set 21 : One other idea #Patch Set 22 : One other idea #Patch Set 23 : Back to the original test fix #
Total comments: 2
Patch Set 24 : Drop unnecessary wait onReceivedError #Patch Set 25 : Oops, fix compile #
Total comments: 2
Patch Set 26 : Emulate onPageFinished #
Messages
Total messages: 56 (34 generated)
japhet@chromium.org changed reviewers: + dcheng@chromium.org
This is a post-merge followup to https://codereview.chromium.org/1357763002/. I never got it fully passing bots before. This drops the enough value for data received and replaces it wit a bit, which is more sane than trying to have separate enum values for "not done but empty" and "done but empty".
lgtm
The CQ bit was checked by japhet@chromium.org to run a CQ dry run
Description was changed from ========== DocumentLoader::isCommittedButEmpty is timing-dependent. It's possible for it to be checked after the DocumentLoader has finished, at which point it will incorrectly return false. BUG=520389 ========== to ========== DocumentLoader::isCommittedButEmpty is timing-dependent. It's possible for it to be checked after the DocumentLoader has finished, at which point it will incorrectly return false. BUG=520389, 331745 TEST=DocumentLoaderTest.isCommittedButEmpty ==========
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_androi...)
The CQ bit was checked by japhet@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by japhet@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by japhet@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by japhet@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_compile_dbg on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_comp...) linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_androi...)
The CQ bit was checked by japhet@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
japhet@chromium.org changed reviewers: + sgurun@chromium.org
sgurun, would you mind reviewing this test change? I'm fixing a bug in blink that incorrectly reports empty documents as non-empty, which in turn leads us to show a blank page when we ought to show an error page. However, this bugfix breaks AwContentsClientShouldInterceptRequestTest#testOnReceivedErrorCallback. I believe this is because it expects an onReceievedError callback, which it then expects to trigger an onPageFinished callback. However, this onPageFinished is suppressed for error pages, per https://codereview.chromium.org/1001003004/diff/140001/android_webview/java/s..., and the test times out waiting for it. I think it's sufficient for this test to just verify that it gets the onReceivedError callback, but I'm far enough out of my area of expertise that I'm not at all confident. Does that seem right to you?
On 2016/07/20 18:38:30, Nate Chapin wrote: > sgurun, would you mind reviewing this test change? > > I'm fixing a bug in blink that incorrectly reports empty documents as non-empty, > which in turn leads us to show a blank page when we ought to show an error page. > However, this bugfix breaks > AwContentsClientShouldInterceptRequestTest#testOnReceivedErrorCallback. > > I believe this is because it expects an onReceievedError callback, which it then > expects to trigger an onPageFinished callback. However, this onPageFinished is > suppressed for error pages, per > https://codereview.chromium.org/1001003004/diff/140001/android_webview/java/s..., > and the test times out waiting for it. > > I think it's sufficient for this test to just verify that it gets the > onReceivedError callback, but I'm far enough out of my area of expertise that > I'm not at all confident. Does that seem right to you? himm, actually this is a pretty important piece of callback that is used by webview apps, so require a close investigation. I will check.
On 2016/07/20 18:46:15, sgurun wrote: > On 2016/07/20 18:38:30, Nate Chapin wrote: > > sgurun, would you mind reviewing this test change? > > > > I'm fixing a bug in blink that incorrectly reports empty documents as > non-empty, > > which in turn leads us to show a blank page when we ought to show an error > page. > > However, this bugfix breaks > > AwContentsClientShouldInterceptRequestTest#testOnReceivedErrorCallback. > > > > I believe this is because it expects an onReceievedError callback, which it > then > > expects to trigger an onPageFinished callback. However, this onPageFinished is > > suppressed for error pages, per > > > https://codereview.chromium.org/1001003004/diff/140001/android_webview/java/s..., > > and the test times out waiting for it. > > > > I think it's sufficient for this test to just verify that it gets the > > onReceivedError callback, but I'm far enough out of my area of expertise that > > I'm not at all confident. Does that seem right to you? > > himm, actually this is a pretty important piece of callback that is used by > webview apps, so require a close investigation. I will check. comparing to the previous patch it seems we don't get onreceivederror anymore after this change (because it gave an exception in line 685). But then your final patch to fix is to remove onpagefinished, and add a onreceivederror. I am kind a confused, I wonder if it became flaky and passed just by chance.
sgurun@chromium.org changed reviewers: + gsennton@chromium.org
On 2016/07/21 23:59:43, sgurun wrote: > On 2016/07/20 18:46:15, sgurun wrote: > > On 2016/07/20 18:38:30, Nate Chapin wrote: > > > sgurun, would you mind reviewing this test change? > > > > > > I'm fixing a bug in blink that incorrectly reports empty documents as > > non-empty, > > > which in turn leads us to show a blank page when we ought to show an error > > page. > > > However, this bugfix breaks > > > AwContentsClientShouldInterceptRequestTest#testOnReceivedErrorCallback. > > > > > > I believe this is because it expects an onReceievedError callback, which it > > then > > > expects to trigger an onPageFinished callback. However, this onPageFinished > is > > > suppressed for error pages, per > > > > > > https://codereview.chromium.org/1001003004/diff/140001/android_webview/java/s..., > > > and the test times out waiting for it. > > > > > > I think it's sufficient for this test to just verify that it gets the > > > onReceivedError callback, but I'm far enough out of my area of expertise > that > > > I'm not at all confident. Does that seem right to you? > > > > himm, actually this is a pretty important piece of callback that is used by > > webview apps, so require a close investigation. I will check. > > comparing to the previous patch it seems we don't get onreceivederror anymore > after this change (because it gave an exception in line 685). But then your > final patch to fix is to remove onpagefinished, and add a onreceivederror. I am > kind a confused, I wonder if it became flaky and passed just by chance. Gustav, can you take a look at this change? You dealt with these for a while during shouldoverrideurlloading work.
On 2016/07/20 18:38:30, Nate Chapin wrote: > sgurun, would you mind reviewing this test change? > > I'm fixing a bug in blink that incorrectly reports empty documents as non-empty, > which in turn leads us to show a blank page when we ought to show an error page. > However, this bugfix breaks > AwContentsClientShouldInterceptRequestTest#testOnReceivedErrorCallback. > > I believe this is because it expects an onReceievedError callback, which it then > expects to trigger an onPageFinished callback. However, this onPageFinished is > suppressed for error pages, per > https://codereview.chromium.org/1001003004/diff/140001/android_webview/java/s..., > and the test times out waiting for it. > > I think it's sufficient for this test to just verify that it gets the > onReceivedError callback, but I'm far enough out of my area of expertise that > I'm not at all confident. Does that seem right to you? To ensure we are on the same page here: by "empty documents" you mean a http response with an empty body? It looks like the only reason we are calling onReceivedError in this case is https://chromiumcodereview.appspot.com/12620004 I have no idea whether or not we will break apps by no longer calling onPageFinished for empty responses, but I guess we could just post onPageFinished from shouldInterceptRequest (just like https://chromiumcodereview.appspot.com/12620004 posts onReceivedError) if we do end up breaking apps?
https://codereview.chromium.org/1364863002/diff/430001/android_webview/javate... File android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldInterceptRequestTest.java (right): https://codereview.chromium.org/1364863002/diff/430001/android_webview/javate... android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldInterceptRequestTest.java:684: onReceivedErrorHelper.waitForCallback(onReceivedErrorHelperCallCount, 1); This call is now unnecessary given that you pass onReceivedErrorHelper to loadUrlSync.
https://codereview.chromium.org/1364863002/diff/430001/android_webview/javate... File android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldInterceptRequestTest.java (right): https://codereview.chromium.org/1364863002/diff/430001/android_webview/javate... android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldInterceptRequestTest.java:684: onReceivedErrorHelper.waitForCallback(onReceivedErrorHelperCallCount, 1); On 2016/07/26 15:35:19, gsennton wrote: > This call is now unnecessary given that you pass onReceivedErrorHelper to > loadUrlSync. Done.
On 2016/07/26 15:34:58, gsennton wrote: > On 2016/07/20 18:38:30, Nate Chapin wrote: > > sgurun, would you mind reviewing this test change? > > > > I'm fixing a bug in blink that incorrectly reports empty documents as > non-empty, > > which in turn leads us to show a blank page when we ought to show an error > page. > > However, this bugfix breaks > > AwContentsClientShouldInterceptRequestTest#testOnReceivedErrorCallback. > > > > I believe this is because it expects an onReceievedError callback, which it > then > > expects to trigger an onPageFinished callback. However, this onPageFinished is > > suppressed for error pages, per > > > https://codereview.chromium.org/1001003004/diff/140001/android_webview/java/s..., > > and the test times out waiting for it. > > > > I think it's sufficient for this test to just verify that it gets the > > onReceivedError callback, but I'm far enough out of my area of expertise that > > I'm not at all confident. Does that seem right to you? > > To ensure we are on the same page here: by "empty documents" you mean a http > response with an empty body? > It looks like the only reason we are calling onReceivedError in this case is > https://chromiumcodereview.appspot.com/12620004 Correct. The bug I'm fixing is specific to an empty body on a HTTP 4xx/5xx response, but I don't think the status code matters for the android_webview test breakage? > > I have no idea whether or not we will break apps by no longer calling > onPageFinished for empty responses, but I guess we could just post > onPageFinished from shouldInterceptRequest (just like > https://chromiumcodereview.appspot.com/12620004 posts onReceivedError) if we do > end up breaking apps? I'd believe that. Would you like me to emulate the onPageFinished in this CL, or wait to see if not calling onPageFinished actually breaks something?
The CQ bit was checked by japhet@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_clang_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_clan...)
The CQ bit was checked by japhet@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
On 2016/07/26 18:40:38, Nate Chapin wrote: > On 2016/07/26 15:34:58, gsennton wrote: > > On 2016/07/20 18:38:30, Nate Chapin wrote: > > > sgurun, would you mind reviewing this test change? > > > > > > I'm fixing a bug in blink that incorrectly reports empty documents as > > non-empty, > > > which in turn leads us to show a blank page when we ought to show an error > > page. > > > However, this bugfix breaks > > > AwContentsClientShouldInterceptRequestTest#testOnReceivedErrorCallback. > > > > > > I believe this is because it expects an onReceievedError callback, which it > > then > > > expects to trigger an onPageFinished callback. However, this onPageFinished > is > > > suppressed for error pages, per > > > > > > https://codereview.chromium.org/1001003004/diff/140001/android_webview/java/s..., > > > and the test times out waiting for it. > > > > > > I think it's sufficient for this test to just verify that it gets the > > > onReceivedError callback, but I'm far enough out of my area of expertise > that > > > I'm not at all confident. Does that seem right to you? > > > > To ensure we are on the same page here: by "empty documents" you mean a http > > response with an empty body? > > It looks like the only reason we are calling onReceivedError in this case is > > https://chromiumcodereview.appspot.com/12620004 > > Correct. The bug I'm fixing is specific to an empty body on a HTTP 4xx/5xx > response, > but I don't think the status code matters for the android_webview test breakage? > > > > > I have no idea whether or not we will break apps by no longer calling > > onPageFinished for empty responses, but I guess we could just post > > onPageFinished from shouldInterceptRequest (just like > > https://chromiumcodereview.appspot.com/12620004 posts onReceivedError) if we > do > > end up breaking apps? > > I'd believe that. Would you like me to emulate the onPageFinished in this CL, or > wait to see if not calling onPageFinished actually breaks something? I prefer calling onPageFinished to prevent behavioral change. No matter how subtle the change is, it is not possible for us to monitor behavior of apps (we don't have UMA). So let's not break if possible.
On 2016/07/27 02:10:10, sgurun wrote: > On 2016/07/26 18:40:38, Nate Chapin wrote: > > On 2016/07/26 15:34:58, gsennton wrote: > > > On 2016/07/20 18:38:30, Nate Chapin wrote: > > > > sgurun, would you mind reviewing this test change? > > > > > > > > I'm fixing a bug in blink that incorrectly reports empty documents as > > > non-empty, > > > > which in turn leads us to show a blank page when we ought to show an error > > > page. > > > > However, this bugfix breaks > > > > AwContentsClientShouldInterceptRequestTest#testOnReceivedErrorCallback. > > > > > > > > I believe this is because it expects an onReceievedError callback, which > it > > > then > > > > expects to trigger an onPageFinished callback. However, this > onPageFinished > > is > > > > suppressed for error pages, per > > > > > > > > > > https://codereview.chromium.org/1001003004/diff/140001/android_webview/java/s..., > > > > and the test times out waiting for it. > > > > > > > > I think it's sufficient for this test to just verify that it gets the > > > > onReceivedError callback, but I'm far enough out of my area of expertise > > that > > > > I'm not at all confident. Does that seem right to you? > > > > > > To ensure we are on the same page here: by "empty documents" you mean a http > > > response with an empty body? > > > It looks like the only reason we are calling onReceivedError in this case is > > > https://chromiumcodereview.appspot.com/12620004 > > > > Correct. The bug I'm fixing is specific to an empty body on a HTTP 4xx/5xx > > response, > > but I don't think the status code matters for the android_webview test > breakage? > > > > > > > > I have no idea whether or not we will break apps by no longer calling > > > onPageFinished for empty responses, but I guess we could just post > > > onPageFinished from shouldInterceptRequest (just like > > > https://chromiumcodereview.appspot.com/12620004 posts onReceivedError) if we > > do > > > end up breaking apps? > > > > I'd believe that. Would you like me to emulate the onPageFinished in this CL, > or > > wait to see if not calling onPageFinished actually breaks something? > > I prefer calling onPageFinished to prevent behavioral change. No matter how > subtle the change is, it is not possible for us to monitor behavior of apps (we > don't have UMA). So let's not break if possible. I think the callback should be here: https://cs.chromium.org/chromium/src/android_webview/java/src/org/chromium/an...
Alright, yeah, I agree with Selim here, let's just emulate the onPageFinished in this CL. Could you also change the corresponding comment to indicate that an empty response won't trigger neither onReceivedError nor onPageFinished, and therefore we synthesize both callbacks (currently the comment only indicates that we need to emulate onReceivedError)? https://codereview.chromium.org/1364863002/diff/470001/android_webview/javate... File android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldInterceptRequestTest.java (right): https://codereview.chromium.org/1364863002/diff/470001/android_webview/javate... android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldInterceptRequestTest.java:679: public void testOnReceivedErrorCallback() throws Throwable { Reminder: now that we want to emulate the onPageFinished call ourselves this test should be left unchanged (so that we wait both for onPageFinished and onReceivedError).
The CQ bit was checked by japhet@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
OK, now emulating onPageFinished, PTAL. https://codereview.chromium.org/1364863002/diff/470001/android_webview/javate... File android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldInterceptRequestTest.java (right): https://codereview.chromium.org/1364863002/diff/470001/android_webview/javate... android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldInterceptRequestTest.java:679: public void testOnReceivedErrorCallback() throws Throwable { On 2016/07/27 09:38:09, gsennton wrote: > Reminder: now that we want to emulate the onPageFinished call ourselves this > test should be left unchanged (so that we wait both for onPageFinished and > onReceivedError). Done.
On 2016/07/27 22:21:27, Nate Chapin wrote: > OK, now emulating onPageFinished, PTAL. > > https://codereview.chromium.org/1364863002/diff/470001/android_webview/javate... > File > android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldInterceptRequestTest.java > (right): > > https://codereview.chromium.org/1364863002/diff/470001/android_webview/javate... > android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldInterceptRequestTest.java:679: > public void testOnReceivedErrorCallback() throws Throwable { > On 2016/07/27 09:38:09, gsennton wrote: > > Reminder: now that we want to emulate the onPageFinished call ourselves this > > test should be left unchanged (so that we wait both for onPageFinished and > > onReceivedError). > > Done. lgtm, hopefully the tests will pass :)
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by japhet@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from dcheng@chromium.org Link to the patchset: https://codereview.chromium.org/1364863002/#ps490001 (title: "Emulate onPageFinished")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== DocumentLoader::isCommittedButEmpty is timing-dependent. It's possible for it to be checked after the DocumentLoader has finished, at which point it will incorrectly return false. BUG=520389, 331745 TEST=DocumentLoaderTest.isCommittedButEmpty ========== to ========== DocumentLoader::isCommittedButEmpty is timing-dependent. It's possible for it to be checked after the DocumentLoader has finished, at which point it will incorrectly return false. BUG=520389, 331745 TEST=DocumentLoaderTest.isCommittedButEmpty ==========
Message was sent while issue was closed.
Committed patchset #26 (id:490001)
Message was sent while issue was closed.
Description was changed from ========== DocumentLoader::isCommittedButEmpty is timing-dependent. It's possible for it to be checked after the DocumentLoader has finished, at which point it will incorrectly return false. BUG=520389, 331745 TEST=DocumentLoaderTest.isCommittedButEmpty ========== to ========== DocumentLoader::isCommittedButEmpty is timing-dependent. It's possible for it to be checked after the DocumentLoader has finished, at which point it will incorrectly return false. BUG=520389, 331745 TEST=DocumentLoaderTest.isCommittedButEmpty Committed: https://crrev.com/dbb678baafd71e3af774d34cbac20b860b8f674e Cr-Commit-Position: refs/heads/master@{#408277} ==========
Message was sent while issue was closed.
Patchset 26 (id:??) landed as https://crrev.com/dbb678baafd71e3af774d34cbac20b860b8f674e Cr-Commit-Position: refs/heads/master@{#408277} |