New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 777763 link

Starred by 4 users

Issue metadata

Status: Closed
Owner:
Last visit > 30 days ago
Closed: Aug 17
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Virtual Time needs to be more reliable

Project Member Reported by alexclarke@chromium.org, Oct 24 2017

Issue description

Virtual Time* works well for simple sites, but there are a number of sites where it doesn't work properly notably youtube.

General problems include: Virtual time incorrectly advancing while asynchronous operations such as dom storage lookups are in flight.  The media stack may be issuing network requests which the VebViewScheduler isn't aware of.  Finally the begin frame source isn't currently synchronised to virtual time without an eternal script issuing devtools commands.

We should try and fix all of these to make virtual time production ready.

* https://docs.google.com/document/d/1y9KDT_ZEzT7pBeY6uzVt1dgKlwc1OB_vY4NZO1zBQmo/edit
 
Project Member

Comment 2 by bugdroid1@chromium.org, Oct 27 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d7b11b666ab983920d5fddb7fb09b45bc657de70

commit d7b11b666ab983920d5fddb7fb09b45bc657de70
Author: Alex Clarke <alexclarke@chromium.org>
Date: Fri Oct 27 22:07:50 2017

Virtual time should not get blocked by deferred loads

Bug:  777763 
Change-Id: Iaf0a0e110b3d86c45387600fc4cf4efdc885f527
Reviewed-on: https://chromium-review.googlesource.com/741587
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512313}
[modify] https://crrev.com/d7b11b666ab983920d5fddb7fb09b45bc657de70/headless/lib/virtual_time_browsertest.cc
[add] https://crrev.com/d7b11b666ab983920d5fddb7fb09b45bc657de70/headless/test/data/tulip2.webm
[modify] https://crrev.com/d7b11b666ab983920d5fddb7fb09b45bc657de70/third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp

Project Member

Comment 3 by bugdroid1@chromium.org, Oct 31 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ba2feba73d7d032cda6f729752f18f6e8ac60ef2

commit ba2feba73d7d032cda6f729752f18f6e8ac60ef2
Author: Alex Clarke <alexclarke@chromium.org>
Date: Tue Oct 31 09:09:42 2017

Simplify handling of virtual time by introducing ScopedVirtualTimePauser

This refactor should not change behaviour.

Bug:  777763 
Change-Id: I73e68c4b1d29afded6bda984cbbb0c33cb7cebbd
Reviewed-on: https://chromium-review.googlesource.com/743626
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512785}
[modify] https://crrev.com/ba2feba73d7d032cda6f729752f18f6e8ac60ef2/third_party/WebKit/Source/core/exported/LocalFrameClientImpl.cpp
[modify] https://crrev.com/ba2feba73d7d032cda6f729752f18f6e8ac60ef2/third_party/WebKit/Source/core/exported/LocalFrameClientImpl.h
[modify] https://crrev.com/ba2feba73d7d032cda6f729752f18f6e8ac60ef2/third_party/WebKit/Source/core/frame/LocalFrameClient.h
[modify] https://crrev.com/ba2feba73d7d032cda6f729752f18f6e8ac60ef2/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp
[modify] https://crrev.com/ba2feba73d7d032cda6f729752f18f6e8ac60ef2/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp
[modify] https://crrev.com/ba2feba73d7d032cda6f729752f18f6e8ac60ef2/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.h
[modify] https://crrev.com/ba2feba73d7d032cda6f729752f18f6e8ac60ef2/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
[modify] https://crrev.com/ba2feba73d7d032cda6f729752f18f6e8ac60ef2/third_party/WebKit/Source/core/loader/EmptyClients.cpp
[modify] https://crrev.com/ba2feba73d7d032cda6f729752f18f6e8ac60ef2/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
[modify] https://crrev.com/ba2feba73d7d032cda6f729752f18f6e8ac60ef2/third_party/WebKit/Source/platform/BUILD.gn
[add] https://crrev.com/ba2feba73d7d032cda6f729752f18f6e8ac60ef2/third_party/WebKit/Source/platform/ScopedVirtualTimePauser.h
[modify] https://crrev.com/ba2feba73d7d032cda6f729752f18f6e8ac60ef2/third_party/WebKit/Source/platform/WebFrameScheduler.h
[modify] https://crrev.com/ba2feba73d7d032cda6f729752f18f6e8ac60ef2/third_party/WebKit/Source/platform/loader/fetch/Resource.h
[modify] https://crrev.com/ba2feba73d7d032cda6f729752f18f6e8ac60ef2/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
[modify] https://crrev.com/ba2feba73d7d032cda6f729752f18f6e8ac60ef2/third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp
[modify] https://crrev.com/ba2feba73d7d032cda6f729752f18f6e8ac60ef2/third_party/WebKit/Source/platform/scheduler/BUILD.gn
[add] https://crrev.com/ba2feba73d7d032cda6f729752f18f6e8ac60ef2/third_party/WebKit/Source/platform/scheduler/renderer/scoped_virtual_time_pauser.cc
[modify] https://crrev.com/ba2feba73d7d032cda6f729752f18f6e8ac60ef2/third_party/WebKit/Source/platform/scheduler/renderer/web_frame_scheduler_impl.cc
[modify] https://crrev.com/ba2feba73d7d032cda6f729752f18f6e8ac60ef2/third_party/WebKit/Source/platform/scheduler/renderer/web_frame_scheduler_impl.h
[modify] https://crrev.com/ba2feba73d7d032cda6f729752f18f6e8ac60ef2/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl.cc
[modify] https://crrev.com/ba2feba73d7d032cda6f729752f18f6e8ac60ef2/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl.h
[modify] https://crrev.com/ba2feba73d7d032cda6f729752f18f6e8ac60ef2/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl_unittest.cc
[modify] https://crrev.com/ba2feba73d7d032cda6f729752f18f6e8ac60ef2/third_party/WebKit/Source/platform/scheduler/test/fake_web_frame_scheduler.h

Status: Assigned (was: Untriaged)
Project Member

Comment 6 by bugdroid1@chromium.org, Nov 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/20eb9f8787a3a19c31c15d096f0164b8b241d113

commit 20eb9f8787a3a19c31c15d096f0164b8b241d113
Author: Alex Clarke <alexclarke@chromium.org>
Date: Thu Nov 09 21:52:10 2017

Move VirtualTime tracking to RendererSchedulerImpl

This will make it easier to expose a WebScopedVirtualTimePauser to
content.

Bug:  777763 
Change-Id: I5f7db42698d7bc2e6a8e3ab1ae87a8257f194bbb
Reviewed-on: https://chromium-review.googlesource.com/757141
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#515305}
[modify] https://crrev.com/20eb9f8787a3a19c31c15d096f0164b8b241d113/third_party/WebKit/Source/platform/ScopedVirtualTimePauser.h
[modify] https://crrev.com/20eb9f8787a3a19c31c15d096f0164b8b241d113/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc
[modify] https://crrev.com/20eb9f8787a3a19c31c15d096f0164b8b241d113/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h
[modify] https://crrev.com/20eb9f8787a3a19c31c15d096f0164b8b241d113/third_party/WebKit/Source/platform/scheduler/renderer/scoped_virtual_time_pauser.cc
[modify] https://crrev.com/20eb9f8787a3a19c31c15d096f0164b8b241d113/third_party/WebKit/Source/platform/scheduler/renderer/web_frame_scheduler_impl.cc
[modify] https://crrev.com/20eb9f8787a3a19c31c15d096f0164b8b241d113/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl.cc
[modify] https://crrev.com/20eb9f8787a3a19c31c15d096f0164b8b241d113/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl.h
[modify] https://crrev.com/20eb9f8787a3a19c31c15d096f0164b8b241d113/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl_unittest.cc
[modify] https://crrev.com/20eb9f8787a3a19c31c15d096f0164b8b241d113/third_party/WebKit/Source/platform/scheduler/test/fake_renderer_scheduler.cc
[modify] https://crrev.com/20eb9f8787a3a19c31c15d096f0164b8b241d113/third_party/WebKit/public/platform/scheduler/renderer/renderer_scheduler.h
[modify] https://crrev.com/20eb9f8787a3a19c31c15d096f0164b8b241d113/third_party/WebKit/public/platform/scheduler/test/fake_renderer_scheduler.h

Project Member

Comment 7 by bugdroid1@chromium.org, Nov 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7e8510fa65b88383975885c39c0a31f0abda8ab2

commit 7e8510fa65b88383975885c39c0a31f0abda8ab2
Author: Alex Clarke <alexclarke@chromium.org>
Date: Fri Nov 10 16:37:23 2017

VirtualTimeController to set policy once with multiple tasks

There was a bug where the initial calls to NotifyTaskBudgetRequested
with multiple tasks was causing policy to get set multiple times.
This would flakily cause more virtual time budget to be granted than
intended.

Bug:  777763 
Change-Id: I317046a611489a7da29026103d2083e1a30a8b0f
Reviewed-on: https://chromium-review.googlesource.com/763456
Reviewed-by: Alexander Timin <altimin@chromium.org>
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#515569}
[modify] https://crrev.com/7e8510fa65b88383975885c39c0a31f0abda8ab2/headless/public/util/virtual_time_controller.h
[modify] https://crrev.com/7e8510fa65b88383975885c39c0a31f0abda8ab2/headless/public/util/virtual_time_controller_test.cc

Project Member

Comment 8 by bugdroid1@chromium.org, Nov 16 2017

Project Member

Comment 9 by bugdroid1@chromium.org, Nov 20 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/37df5b9a8024e4863f452ab570b38cfcbafc48e9

commit 37df5b9a8024e4863f452ab570b38cfcbafc48e9
Author: Alex Clarke <alexclarke@chromium.org>
Date: Mon Nov 20 18:07:19 2017

Prevent VirtualTime from advancing when there are pending DomStorage messages.

This is important because otherwise there will be a race between the virtual
time budget expiring and the side effects of asynchronous dom storage methods.

Bug:  777763 
Change-Id: I41481070958a0e47232c8d5f22fbfbe5894ec605
Reviewed-on: https://chromium-review.googlesource.com/730711
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517861}
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/content/renderer/dom_storage/DEPS
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/content/renderer/dom_storage/dom_storage_cached_area.cc
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/content/renderer/dom_storage/dom_storage_cached_area.h
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/content/renderer/dom_storage/dom_storage_cached_area_unittest.cc
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/content/renderer/dom_storage/dom_storage_dispatcher.cc
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/content/renderer/dom_storage/local_storage_cached_area.cc
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/content/renderer/dom_storage/local_storage_cached_area.h
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/content/renderer/dom_storage/local_storage_cached_area_unittest.cc
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/content/renderer/dom_storage/local_storage_cached_areas.cc
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/content/renderer/dom_storage/local_storage_cached_areas.h
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/content/renderer/dom_storage/local_storage_cached_areas_unittest.cc
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/content/renderer/renderer_blink_platform_impl.cc
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/headless/lib/virtual_time_browsertest.cc
[add] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/headless/test/data/virtual_time_local_storage.html
[add] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/headless/test/data/virtual_time_session_storage.html
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/third_party/WebKit/Source/core/exported/LocalFrameClientImpl.cpp
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/third_party/WebKit/Source/core/exported/LocalFrameClientImpl.h
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/third_party/WebKit/Source/core/frame/LocalFrameClient.h
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.h
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/third_party/WebKit/Source/core/loader/EmptyClients.cpp
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/third_party/WebKit/Source/platform/BUILD.gn
[delete] https://crrev.com/b84f2295897d84d979f05871ca391033d1bff006/third_party/WebKit/Source/platform/ScopedVirtualTimePauser.h
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/third_party/WebKit/Source/platform/WebFrameScheduler.h
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/third_party/WebKit/Source/platform/loader/fetch/Resource.h
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/third_party/WebKit/Source/platform/scheduler/renderer/scoped_virtual_time_pauser.cc
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/third_party/WebKit/Source/platform/scheduler/renderer/web_frame_scheduler_impl.cc
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/third_party/WebKit/Source/platform/scheduler/renderer/web_frame_scheduler_impl.h
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl_unittest.cc
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/third_party/WebKit/Source/platform/scheduler/test/fake_renderer_scheduler.cc
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/third_party/WebKit/Source/platform/scheduler/test/fake_web_frame_scheduler.h
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/third_party/WebKit/public/BUILD.gn
[add] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/third_party/WebKit/public/platform/WebScopedVirtualTimePauser.h
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/third_party/WebKit/public/platform/scheduler/renderer/renderer_scheduler.h
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/third_party/WebKit/public/platform/scheduler/test/fake_renderer_scheduler.h
[modify] https://crrev.com/37df5b9a8024e4863f452ab570b38cfcbafc48e9/third_party/WebKit/public/platform/scheduler/test/mock_renderer_scheduler.h

Project Member

Comment 10 by bugdroid1@chromium.org, Nov 24 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bf3dceb7cbd46c62d31715f9f7ef28f4b4e20ebf

commit bf3dceb7cbd46c62d31715f9f7ef28f4b4e20ebf
Author: Alex Clarke <alexclarke@chromium.org>
Date: Fri Nov 24 12:27:43 2017

Fix a bug with history navigation and virtual time

Its possible for the main frame to have several child frames with navigation
history.  If history.back() is called those child frame will navigate but
the main frame wont.  This is a problem for virtual time because the main
frame's LocalFrameClientImpl::NavigateBackForward will (correctly) block
virtual time but only the child frames will recieve calls to
LocalFrameClientImpl::DispatchDidCommitLoad.

This patch moves tracking of pending history navigations to RenderViewImpl
which solves the problem.

Bug:  765366 ,  777763 
Change-Id: I8f97cfec5164541948910d92b7485d591c91d9d8
Reviewed-on: https://chromium-review.googlesource.com/787671
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519090}
[modify] https://crrev.com/bf3dceb7cbd46c62d31715f9f7ef28f4b4e20ebf/content/renderer/render_frame_impl.cc
[modify] https://crrev.com/bf3dceb7cbd46c62d31715f9f7ef28f4b4e20ebf/content/renderer/render_view_impl.cc
[modify] https://crrev.com/bf3dceb7cbd46c62d31715f9f7ef28f4b4e20ebf/content/renderer/render_view_impl.h
[modify] https://crrev.com/bf3dceb7cbd46c62d31715f9f7ef28f4b4e20ebf/headless/lib/virtual_time_browsertest.cc
[modify] https://crrev.com/bf3dceb7cbd46c62d31715f9f7ef28f4b4e20ebf/third_party/WebKit/Source/core/exported/LocalFrameClientImpl.cpp

Project Member

Comment 11 by bugdroid1@chromium.org, Dec 11 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/562ea3effccaf5ed5b7ba602ecb0899a261a1651

commit 562ea3effccaf5ed5b7ba602ecb0899a261a1651
Author: Alex Clarke <alexclarke@chromium.org>
Date: Mon Dec 11 13:35:30 2017

The background parser doesn't need to block Virtual Time anymore

For determinism Virtual Time needed to be blocked when the background
parser was running on the background thread.  That thread no longer
exists (it now runs on the main thread) so we can remove the
WebScopedVirtualTimePauser.

Bug:  777763 
Change-Id: I0c5f31fcb8c7dbd45ac922be831951143f1c48a9
Reviewed-on: https://chromium-review.googlesource.com/817747
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523085}
[modify] https://crrev.com/562ea3effccaf5ed5b7ba602ecb0899a261a1651/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp
[modify] https://crrev.com/562ea3effccaf5ed5b7ba602ecb0899a261a1651/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.h

Project Member

Comment 12 by bugdroid1@chromium.org, Jan 12 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0b954c48a42bb80cf7930a3764b1fa96cb64a6c6

commit 0b954c48a42bb80cf7930a3764b1fa96cb64a6c6
Author: Alex Clarke <alexclarke@chromium.org>
Date: Fri Jan 12 16:38:01 2018

Fix a bug where virtual time may pause indefinitely

A page like the following could cause virtual time to pause forever
because the new fetch occurs in the same task as the handling of the
error. We fix this by making WebScopedVirtualTimePausers advance
virtual time a little.  The idea is they sample virtual time when
paused and try to advance virtual time to 10ms after when they unpause.
If a bunch of WebScopedVirtualTimePausers overlap then virtual time will
only advance slowly - this is by design we don't want to require excessive
amounts of virtual time for pages to 'complete'.

This keeps determinism, while advancing virtual time even if web content
has unfortunate code like this:

<html>
<script>
var counter = 1;
</script>
<img src="1" onerror="this.src='' + ++counter;">
</html>

Bug:  777763 
Change-Id: I14e7d1abd5d4c4746656fce634a33cc126680b56
Reviewed-on: https://chromium-review.googlesource.com/793033
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528965}
[modify] https://crrev.com/0b954c48a42bb80cf7930a3764b1fa96cb64a6c6/headless/lib/virtual_time_browsertest.cc
[modify] https://crrev.com/0b954c48a42bb80cf7930a3764b1fa96cb64a6c6/headless/public/util/testing/test_in_memory_protocol_handler.cc
[modify] https://crrev.com/0b954c48a42bb80cf7930a3764b1fa96cb64a6c6/third_party/WebKit/Source/core/scheduler/VirtualTimeTest.cpp
[modify] https://crrev.com/0b954c48a42bb80cf7930a3764b1fa96cb64a6c6/third_party/WebKit/Source/platform/scheduler/BUILD.gn
[modify] https://crrev.com/0b954c48a42bb80cf7930a3764b1fa96cb64a6c6/third_party/WebKit/Source/platform/scheduler/renderer/auto_advancing_virtual_time_domain.cc
[modify] https://crrev.com/0b954c48a42bb80cf7930a3764b1fa96cb64a6c6/third_party/WebKit/Source/platform/scheduler/renderer/auto_advancing_virtual_time_domain.h
[modify] https://crrev.com/0b954c48a42bb80cf7930a3764b1fa96cb64a6c6/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc
[modify] https://crrev.com/0b954c48a42bb80cf7930a3764b1fa96cb64a6c6/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h
[delete] https://crrev.com/ba65e19b3a7a5f4b996f7168093f21561b7a0c7f/third_party/WebKit/Source/platform/scheduler/renderer/scoped_virtual_time_pauser.cc
[add] https://crrev.com/0b954c48a42bb80cf7930a3764b1fa96cb64a6c6/third_party/WebKit/Source/platform/scheduler/renderer/web_scoped_virtual_time_pauser.cc
[modify] https://crrev.com/0b954c48a42bb80cf7930a3764b1fa96cb64a6c6/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl.cc
[modify] https://crrev.com/0b954c48a42bb80cf7930a3764b1fa96cb64a6c6/third_party/WebKit/public/platform/WebScopedVirtualTimePauser.h

Project Member

Comment 13 by bugdroid1@chromium.org, Jan 12 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4c6a7e956d1b7ea911b8eb6ff1393e7912efe1eb

commit 4c6a7e956d1b7ea911b8eb6ff1393e7912efe1eb
Author: Nate Chapin <japhet@chromium.org>
Date: Fri Jan 12 22:25:20 2018

Revert "Fix a bug where virtual time may pause indefinitely"

This reverts commit 0b954c48a42bb80cf7930a3764b1fa96cb64a6c6.

Reason for revert: Suspected cause of flaky test VirtualTimeAndResourceErrorLoopTest.RunAsyncTest
https://ci.chromium.org/buildbot/chromium.win/Win7%20Tests%20%281%29/75727

Original change's description:
> Fix a bug where virtual time may pause indefinitely
> 
> A page like the following could cause virtual time to pause forever
> because the new fetch occurs in the same task as the handling of the
> error. We fix this by making WebScopedVirtualTimePausers advance
> virtual time a little.  The idea is they sample virtual time when
> paused and try to advance virtual time to 10ms after when they unpause.
> If a bunch of WebScopedVirtualTimePausers overlap then virtual time will
> only advance slowly - this is by design we don't want to require excessive
> amounts of virtual time for pages to 'complete'.
> 
> This keeps determinism, while advancing virtual time even if web content
> has unfortunate code like this:
> 
> <html>
> <script>
> var counter = 1;
> </script>
> <img src="1" onerror="this.src='' + ++counter;">
> </html>
> 
> Bug:  777763 
> Change-Id: I14e7d1abd5d4c4746656fce634a33cc126680b56
> Reviewed-on: https://chromium-review.googlesource.com/793033
> Commit-Queue: Alex Clarke <alexclarke@chromium.org>
> Reviewed-by: Kentaro Hara <haraken@chromium.org>
> Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#528965}

TBR=haraken@chromium.org,skyostil@chromium.org,alexclarke@chromium.org

Change-Id: I29363d3ff7334e88b2ccbd521965691880ad3c1b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug:  777763 
Reviewed-on: https://chromium-review.googlesource.com/865774
Reviewed-by: Nate Chapin <japhet@chromium.org>
Commit-Queue: Nate Chapin <japhet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#529087}
[modify] https://crrev.com/4c6a7e956d1b7ea911b8eb6ff1393e7912efe1eb/headless/lib/virtual_time_browsertest.cc
[modify] https://crrev.com/4c6a7e956d1b7ea911b8eb6ff1393e7912efe1eb/headless/public/util/testing/test_in_memory_protocol_handler.cc
[modify] https://crrev.com/4c6a7e956d1b7ea911b8eb6ff1393e7912efe1eb/third_party/WebKit/Source/core/scheduler/VirtualTimeTest.cpp
[modify] https://crrev.com/4c6a7e956d1b7ea911b8eb6ff1393e7912efe1eb/third_party/WebKit/Source/platform/scheduler/BUILD.gn
[modify] https://crrev.com/4c6a7e956d1b7ea911b8eb6ff1393e7912efe1eb/third_party/WebKit/Source/platform/scheduler/renderer/auto_advancing_virtual_time_domain.cc
[modify] https://crrev.com/4c6a7e956d1b7ea911b8eb6ff1393e7912efe1eb/third_party/WebKit/Source/platform/scheduler/renderer/auto_advancing_virtual_time_domain.h
[modify] https://crrev.com/4c6a7e956d1b7ea911b8eb6ff1393e7912efe1eb/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc
[modify] https://crrev.com/4c6a7e956d1b7ea911b8eb6ff1393e7912efe1eb/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h
[add] https://crrev.com/4c6a7e956d1b7ea911b8eb6ff1393e7912efe1eb/third_party/WebKit/Source/platform/scheduler/renderer/scoped_virtual_time_pauser.cc
[delete] https://crrev.com/010fad40d12a9c85211312d4a9735171787806fe/third_party/WebKit/Source/platform/scheduler/renderer/web_scoped_virtual_time_pauser.cc
[modify] https://crrev.com/4c6a7e956d1b7ea911b8eb6ff1393e7912efe1eb/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl.cc
[modify] https://crrev.com/4c6a7e956d1b7ea911b8eb6ff1393e7912efe1eb/third_party/WebKit/public/platform/WebScopedVirtualTimePauser.h

Project Member

Comment 14 by bugdroid1@chromium.org, Jan 15 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a3d7d63f8c05d5ae6f8eaadea61c1cc682a270f3

commit a3d7d63f8c05d5ae6f8eaadea61c1cc682a270f3
Author: Alex Clarke <alexclarke@chromium.org>
Date: Mon Jan 15 14:46:55 2018

Virtual time needs to pause while there are PendingScripts waiting to load

Bug:  777763 
Change-Id: Id5fbeacc4435cd59f446d8fea0c61718a1acde26
Reviewed-on: https://chromium-review.googlesource.com/864025
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#529277}
[modify] https://crrev.com/a3d7d63f8c05d5ae6f8eaadea61c1cc682a270f3/headless/lib/virtual_time_browsertest.cc
[modify] https://crrev.com/a3d7d63f8c05d5ae6f8eaadea61c1cc682a270f3/third_party/WebKit/Source/core/script/PendingScript.cpp
[modify] https://crrev.com/a3d7d63f8c05d5ae6f8eaadea61c1cc682a270f3/third_party/WebKit/Source/core/script/PendingScript.h

Project Member

Comment 15 by bugdroid1@chromium.org, Jan 16 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/12243e0ff754555bd3492725bf75a80f15264cba

commit 12243e0ff754555bd3492725bf75a80f15264cba
Author: Alex Clarke <alexclarke@chromium.org>
Date: Tue Jan 16 08:23:56 2018

[Reland] Fix a bug where virtual time may pause indefinitely

Reland of https://chromium-review.googlesource.com/c/chromium/src/+/793033
with a fix to VirtualTimeAndResourceErrorLoopTest which was flaky.

That test is unusual because it's sensitive to the anti-starvation
mechanism for delayed tasks.  The fix is to set the threshold for that
to a very high level so it's highly unlikely to trigger during the test
run.

Also fixes some lifetime bugs in headless which where making the new
browser test flaky.

Bug:  777763 
Change-Id: Ib36dc90b866fad9cd5a9914b069ddb6d8f0deb52
Reviewed-on: https://chromium-review.googlesource.com/865896
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#529381}
[modify] https://crrev.com/12243e0ff754555bd3492725bf75a80f15264cba/headless/lib/browser/headless_browser_context_impl.cc
[modify] https://crrev.com/12243e0ff754555bd3492725bf75a80f15264cba/headless/lib/browser/headless_browser_context_impl.h
[modify] https://crrev.com/12243e0ff754555bd3492725bf75a80f15264cba/headless/lib/browser/headless_url_request_context_getter.cc
[modify] https://crrev.com/12243e0ff754555bd3492725bf75a80f15264cba/headless/lib/browser/headless_url_request_context_getter.h
[modify] https://crrev.com/12243e0ff754555bd3492725bf75a80f15264cba/headless/lib/virtual_time_browsertest.cc
[modify] https://crrev.com/12243e0ff754555bd3492725bf75a80f15264cba/headless/public/util/expedited_dispatcher.cc
[modify] https://crrev.com/12243e0ff754555bd3492725bf75a80f15264cba/headless/public/util/managed_dispatch_url_request_job.cc
[modify] https://crrev.com/12243e0ff754555bd3492725bf75a80f15264cba/headless/public/util/managed_dispatch_url_request_job.h
[modify] https://crrev.com/12243e0ff754555bd3492725bf75a80f15264cba/headless/public/util/testing/test_in_memory_protocol_handler.cc
[modify] https://crrev.com/12243e0ff754555bd3492725bf75a80f15264cba/headless/public/util/throttled_dispatcher.cc
[modify] https://crrev.com/12243e0ff754555bd3492725bf75a80f15264cba/third_party/WebKit/Source/core/scheduler/VirtualTimeTest.cpp
[modify] https://crrev.com/12243e0ff754555bd3492725bf75a80f15264cba/third_party/WebKit/Source/platform/scheduler/BUILD.gn
[modify] https://crrev.com/12243e0ff754555bd3492725bf75a80f15264cba/third_party/WebKit/Source/platform/scheduler/renderer/auto_advancing_virtual_time_domain.cc
[modify] https://crrev.com/12243e0ff754555bd3492725bf75a80f15264cba/third_party/WebKit/Source/platform/scheduler/renderer/auto_advancing_virtual_time_domain.h
[modify] https://crrev.com/12243e0ff754555bd3492725bf75a80f15264cba/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc
[modify] https://crrev.com/12243e0ff754555bd3492725bf75a80f15264cba/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h
[delete] https://crrev.com/18600ac9cbcc43ecbc01015e31ddf8e6d7345860/third_party/WebKit/Source/platform/scheduler/renderer/scoped_virtual_time_pauser.cc
[add] https://crrev.com/12243e0ff754555bd3492725bf75a80f15264cba/third_party/WebKit/Source/platform/scheduler/renderer/web_scoped_virtual_time_pauser.cc
[modify] https://crrev.com/12243e0ff754555bd3492725bf75a80f15264cba/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl.cc
[modify] https://crrev.com/12243e0ff754555bd3492725bf75a80f15264cba/third_party/WebKit/public/platform/WebScopedVirtualTimePauser.h

Project Member

Comment 16 by bugdroid1@chromium.org, Jan 27 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/27517f2a7803a274e01b64febba3b1fade1fda2e

commit 27517f2a7803a274e01b64febba3b1fade1fda2e
Author: Alex Clarke <alexclarke@chromium.org>
Date: Sat Jan 27 09:40:32 2018

Refactor VirtualTimeController to have a more flexible interface

We now support tasks choosing to extend virtual time.

Bug:  777763 
Change-Id: I34d0f07ecee78fafe75a6e4d2280c6512c6f7e2f
Reviewed-on: https://chromium-review.googlesource.com/889298
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532210}
[modify] https://crrev.com/27517f2a7803a274e01b64febba3b1fade1fda2e/headless/public/util/compositor_controller.cc
[modify] https://crrev.com/27517f2a7803a274e01b64febba3b1fade1fda2e/headless/public/util/compositor_controller_browsertest.cc
[modify] https://crrev.com/27517f2a7803a274e01b64febba3b1fade1fda2e/headless/public/util/compositor_controller_unittest.cc
[modify] https://crrev.com/27517f2a7803a274e01b64febba3b1fade1fda2e/headless/public/util/virtual_time_controller.cc
[modify] https://crrev.com/27517f2a7803a274e01b64febba3b1fade1fda2e/headless/public/util/virtual_time_controller.h
[modify] https://crrev.com/27517f2a7803a274e01b64febba3b1fade1fda2e/headless/public/util/virtual_time_controller_test.cc
[modify] https://crrev.com/27517f2a7803a274e01b64febba3b1fade1fda2e/headless/test/headless_render_test.cc
[modify] https://crrev.com/27517f2a7803a274e01b64febba3b1fade1fda2e/headless/test/headless_render_test.h

Project Member

Comment 17 by bugdroid1@chromium.org, Feb 2 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0aac21e59b9ac9797e06435ad2409215e6e29692

commit 0aac21e59b9ac9797e06435ad2409215e6e29692
Author: Alex Clarke <alexclarke@chromium.org>
Date: Fri Feb 02 22:30:41 2018

Virtual time to optionally override base::Time and base::TimeTicks

We provide a way for Headless C++ embedders to enable virtual time
and override base::Time when the renderer is created (that's the only
safe point to do so). We intend to implement something similar for
Puppeteer at a later date.

Bug:  777763 
Change-Id: I267efcc9ed09245f19592237c8dbf8b28fd2d898
Reviewed-on: https://chromium-review.googlesource.com/894402
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534174}
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/content/public/common/content_switches.cc
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/content/public/common/content_switches.h
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/content/renderer/renderer_main.cc
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/headless/lib/browser/headless_browser_context_impl.cc
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/headless/lib/browser/headless_browser_context_options.cc
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/headless/lib/browser/headless_browser_context_options.h
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/headless/lib/browser/headless_content_browser_client.cc
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/headless/lib/browser/headless_devtools_client_impl.cc
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/headless/lib/virtual_time_browsertest.cc
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/headless/public/headless_browser.cc
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/headless/public/headless_browser.h
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/headless/public/headless_browser_context.h
[add] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/headless/test/data/virtual_time_and_date.html
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/third_party/WebKit/Source/core/scheduler/VirtualTimeTest.cpp
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_perftest.cc
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_unittest.cc
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/third_party/WebKit/Source/platform/scheduler/base/virtual_time_domain.cc
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/third_party/WebKit/Source/platform/scheduler/base/virtual_time_domain.h
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/third_party/WebKit/Source/platform/scheduler/renderer/auto_advancing_virtual_time_domain.cc
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/third_party/WebKit/Source/platform/scheduler/renderer/auto_advancing_virtual_time_domain.h
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/third_party/WebKit/Source/platform/scheduler/renderer/auto_advancing_virtual_time_domain_unittest.cc
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/third_party/WebKit/Source/platform/scheduler/renderer/budget_pool_unittest.cc
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/third_party/WebKit/Source/platform/scheduler/renderer/renderer_metrics_helper.cc
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/third_party/WebKit/Source/platform/scheduler/renderer/renderer_metrics_helper.h
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/third_party/WebKit/Source/platform/scheduler/renderer/renderer_metrics_helper_unittest.cc
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler.cc
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler_unittest.cc
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/third_party/WebKit/Source/platform/scheduler/renderer/web_frame_scheduler_impl_unittest.cc
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl.cc
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl_unittest.cc
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/third_party/WebKit/Source/platform/scheduler/renderer/webthread_impl_for_renderer_scheduler_unittest.cc
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/third_party/WebKit/Source/platform/scheduler/test/renderer_scheduler_test_support.cc
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/third_party/WebKit/Source/platform/scheduler/util/thread_load_tracker.h
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/third_party/WebKit/Source/platform/testing/TestingPlatformSupportWithMockScheduler.cpp
[modify] https://crrev.com/0aac21e59b9ac9797e06435ad2409215e6e29692/third_party/WebKit/public/platform/scheduler/renderer/renderer_scheduler.h

Project Member

Comment 18 by bugdroid1@chromium.org, Feb 7 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b28db5465a47c4d68d4511a4faadf4636df28f86

commit b28db5465a47c4d68d4511a4faadf4636df28f86
Author: Alex Clarke <alexclarke@chromium.org>
Date: Wed Feb 07 12:53:13 2018

WebScopedVirtualTimePauser to optionally advance virtual time

We only want some tasks bookended by WebScopedVirtualTimePauser to
advance virtual time. In general resource loading and local & session
storage should advance virtial time but other uses should not.

Change-Id: I380c645ec2817f226099b0d9970b6183dd8d2a43
Bug:  777763 
Reviewed-on: https://chromium-review.googlesource.com/903770
Reviewed-by: Camille Lamy <clamy@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534988}
[modify] https://crrev.com/b28db5465a47c4d68d4511a4faadf4636df28f86/content/renderer/render_view_impl.cc
[modify] https://crrev.com/b28db5465a47c4d68d4511a4faadf4636df28f86/headless/lib/virtual_time_browsertest.cc
[modify] https://crrev.com/b28db5465a47c4d68d4511a4faadf4636df28f86/headless/test/data/virtual_time_and_date.html
[modify] https://crrev.com/b28db5465a47c4d68d4511a4faadf4636df28f86/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp
[modify] https://crrev.com/b28db5465a47c4d68d4511a4faadf4636df28f86/third_party/WebKit/Source/core/loader/EmptyClients.cpp
[modify] https://crrev.com/b28db5465a47c4d68d4511a4faadf4636df28f86/third_party/WebKit/Source/core/script/PendingScript.cpp
[modify] https://crrev.com/b28db5465a47c4d68d4511a4faadf4636df28f86/third_party/WebKit/Source/platform/WebFrameScheduler.h
[modify] https://crrev.com/b28db5465a47c4d68d4511a4faadf4636df28f86/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
[modify] https://crrev.com/b28db5465a47c4d68d4511a4faadf4636df28f86/third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp
[modify] https://crrev.com/b28db5465a47c4d68d4511a4faadf4636df28f86/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc
[modify] https://crrev.com/b28db5465a47c4d68d4511a4faadf4636df28f86/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h
[modify] https://crrev.com/b28db5465a47c4d68d4511a4faadf4636df28f86/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc
[modify] https://crrev.com/b28db5465a47c4d68d4511a4faadf4636df28f86/third_party/WebKit/Source/platform/scheduler/renderer/web_frame_scheduler_impl.cc
[modify] https://crrev.com/b28db5465a47c4d68d4511a4faadf4636df28f86/third_party/WebKit/Source/platform/scheduler/renderer/web_frame_scheduler_impl.h
[modify] https://crrev.com/b28db5465a47c4d68d4511a4faadf4636df28f86/third_party/WebKit/Source/platform/scheduler/renderer/web_scoped_virtual_time_pauser.cc
[modify] https://crrev.com/b28db5465a47c4d68d4511a4faadf4636df28f86/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl_unittest.cc
[modify] https://crrev.com/b28db5465a47c4d68d4511a4faadf4636df28f86/third_party/WebKit/Source/platform/scheduler/test/fake_renderer_scheduler.cc
[modify] https://crrev.com/b28db5465a47c4d68d4511a4faadf4636df28f86/third_party/WebKit/Source/platform/scheduler/test/fake_web_frame_scheduler.h
[modify] https://crrev.com/b28db5465a47c4d68d4511a4faadf4636df28f86/third_party/WebKit/public/platform/WebScopedVirtualTimePauser.h
[modify] https://crrev.com/b28db5465a47c4d68d4511a4faadf4636df28f86/third_party/WebKit/public/platform/scheduler/renderer/renderer_scheduler.h
[modify] https://crrev.com/b28db5465a47c4d68d4511a4faadf4636df28f86/third_party/WebKit/public/platform/scheduler/test/fake_renderer_scheduler.h
[modify] https://crrev.com/b28db5465a47c4d68d4511a4faadf4636df28f86/third_party/WebKit/public/platform/scheduler/test/mock_renderer_scheduler.h

Project Member

Comment 19 by bugdroid1@chromium.org, Feb 14 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fe2356d15dcb58d467967ea7f88e20e1443b990d

commit fe2356d15dcb58d467967ea7f88e20e1443b990d
Author: Alex Clarke <alexclarke@chromium.org>
Date: Wed Feb 14 15:46:37 2018

Fix bug Emulation.setVirtualTimePolicy and waitForNavigation

If only a single call to Emulation.setVirtualTimePolicy is made with
waitForNavigation:true then addInspectorEmulationAgent wasn't getting
called in time, which meant InspectorEmulationAgent::FrameStartedLoading
wasn't called for the navigation, which meant the virtual time policy
was never changing.

Bug:  777763 
Change-Id: I7525ed1de924319c195ecfdd602c3fad808eba59
Reviewed-on: https://chromium-review.googlesource.com/918665
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#536721}
[modify] https://crrev.com/fe2356d15dcb58d467967ea7f88e20e1443b990d/headless/lib/virtual_time_browsertest.cc
[modify] https://crrev.com/fe2356d15dcb58d467967ea7f88e20e1443b990d/third_party/WebKit/Source/core/inspector/InspectorEmulationAgent.cpp

Project Member

Comment 20 by bugdroid1@chromium.org, Feb 16 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/42d849647d581154851f254e3d9a7752301862e8

commit 42d849647d581154851f254e3d9a7752301862e8
Author: Alex Clarke <alexclarke@chromium.org>
Date: Fri Feb 16 09:13:43 2018

InspectorEmulationAgent::Restore to work with virtual time

This patch plus https://chromium-review.googlesource.com/c/chromium/src/+/921082
Fixes the broken headless browswer tests in
https://chromium-review.googlesource.com/c/chromium/src/+/762520

Bug:  777763 
Change-Id: I44ef4ea78e673129e65d23fdd4cd1169569e478b
Reviewed-on: https://chromium-review.googlesource.com/922622
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537264}
[modify] https://crrev.com/42d849647d581154851f254e3d9a7752301862e8/third_party/WebKit/Source/core/inspector/InspectorEmulationAgent.cpp

Project Member

Comment 21 by bugdroid1@chromium.org, Feb 20 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/872c08a971dc511177a30c56c69119fefc5c3413

commit 872c08a971dc511177a30c56c69119fefc5c3413
Author: Alex Clarke <alexclarke@chromium.org>
Date: Tue Feb 20 15:58:07 2018

Add trace events for Emulation.setVirtualTimePolicy

This makes it much easier to diagnose traces where virtual time is enabled.

Bug:  777763 
Change-Id: I844b2cc189fea2d324692bd2474fe597a2794380
Reviewed-on: https://chromium-review.googlesource.com/926126
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537787}
[modify] https://crrev.com/872c08a971dc511177a30c56c69119fefc5c3413/third_party/WebKit/Source/core/inspector/InspectorEmulationAgent.cpp

Project Member

Comment 22 by bugdroid1@chromium.org, Feb 21 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/428a994ebd95c8634fc3fd5df50ad2a0d62e42d7

commit 428a994ebd95c8634fc3fd5df50ad2a0d62e42d7
Author: Alex Clarke <alexclarke@chromium.org>
Date: Wed Feb 21 13:05:41 2018

Make sure virtual time advances despite cross origin navigation

The previous attempt to fix this didn't work (it segfaulted) and it
wasn't taking into account that when the new renderer spawns it needs
an offset for virtual time or time will appear to go backwards from the
browser's point of view whenever a new renderer spans.

This patch fixes that in so far as the current API allows.  The
InspectorEmulationAgent's state is sent to the browser along with
DevTools protocol command results but not events.  This means that
some progress in the old render may be lost.  That shouldn't be an
issue in practice virtual time is doled out in increments of 100
virtual ms so at worst 99 virtual ms will get wasted.  The render
should still be deterministic (in so far as anything in a browser can
be made deterministic).

In order to test this properly we need to ensure that each site
has a dedicated process so that we can arrange for a series of
navigations that ecercise the restore logic.

Bug:  777763 
Change-Id: I0b3195ed062b8c59de2c43447dc897f954747b00
Reviewed-on: https://chromium-review.googlesource.com/924701
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#538079}
[modify] https://crrev.com/428a994ebd95c8634fc3fd5df50ad2a0d62e42d7/headless/lib/browser/headless_browser_context_impl.cc
[modify] https://crrev.com/428a994ebd95c8634fc3fd5df50ad2a0d62e42d7/headless/lib/browser/headless_browser_context_options.cc
[modify] https://crrev.com/428a994ebd95c8634fc3fd5df50ad2a0d62e42d7/headless/lib/browser/headless_browser_context_options.h
[modify] https://crrev.com/428a994ebd95c8634fc3fd5df50ad2a0d62e42d7/headless/lib/browser/headless_content_browser_client.cc
[modify] https://crrev.com/428a994ebd95c8634fc3fd5df50ad2a0d62e42d7/headless/lib/browser/headless_content_browser_client.h
[modify] https://crrev.com/428a994ebd95c8634fc3fd5df50ad2a0d62e42d7/headless/lib/virtual_time_browsertest.cc
[modify] https://crrev.com/428a994ebd95c8634fc3fd5df50ad2a0d62e42d7/headless/public/headless_browser.cc
[modify] https://crrev.com/428a994ebd95c8634fc3fd5df50ad2a0d62e42d7/headless/public/headless_browser.h
[modify] https://crrev.com/428a994ebd95c8634fc3fd5df50ad2a0d62e42d7/headless/public/headless_browser_context.h
[modify] https://crrev.com/428a994ebd95c8634fc3fd5df50ad2a0d62e42d7/third_party/WebKit/Source/core/inspector/InspectorEmulationAgent.cpp
[modify] https://crrev.com/428a994ebd95c8634fc3fd5df50ad2a0d62e42d7/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc
[modify] https://crrev.com/428a994ebd95c8634fc3fd5df50ad2a0d62e42d7/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h
[modify] https://crrev.com/428a994ebd95c8634fc3fd5df50ad2a0d62e42d7/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler.h
[modify] https://crrev.com/428a994ebd95c8634fc3fd5df50ad2a0d62e42d7/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl.cc
[modify] https://crrev.com/428a994ebd95c8634fc3fd5df50ad2a0d62e42d7/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl.h
[modify] https://crrev.com/428a994ebd95c8634fc3fd5df50ad2a0d62e42d7/third_party/WebKit/Source/platform/scheduler/test/fake_web_view_scheduler.h

Project Member

Comment 23 by bugdroid1@chromium.org, Feb 23 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fc7cc017a0b07e106b6b552cf4418529671fa240

commit fc7cc017a0b07e106b6b552cf4418529671fa240
Author: Eric Seckler <eseckler@chromium.org>
Date: Fri Feb 23 12:17:27 2018

headless: Fix restarting virtual time logic in VirtualTimeController

Tasks are set to block virtual time progression after virtual time is
stopped via ContinuePolicy::STOP. When virtual time is restarted, tasks
should be reset so that they no longer block virtual time progression.

Bug:  777763 
Change-Id: I8039548e98722f8daa0fc661dda13edfd5a5ccd4
Reviewed-on: https://chromium-review.googlesource.com/934288
Reviewed-by: Alex Clarke <alexclarke@chromium.org>
Commit-Queue: Eric Seckler <eseckler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#538764}
[modify] https://crrev.com/fc7cc017a0b07e106b6b552cf4418529671fa240/headless/public/util/virtual_time_controller.cc
[modify] https://crrev.com/fc7cc017a0b07e106b6b552cf4418529671fa240/headless/public/util/virtual_time_controller_test.cc

Project Member

Comment 24 by bugdroid1@chromium.org, Mar 6 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ad6532e12c92025b6417b20b5bc0d31d385f4f2a

commit ad6532e12c92025b6417b20b5bc0d31d385f4f2a
Author: Alex Clarke <alexclarke@chromium.org>
Date: Tue Mar 06 13:34:13 2018

Convert tracing to use the non-overriden versions of base::Time::Now() etc

This will allow meaningful traces to be taken when virtual time is enabled
with base::Time and base::TimeTicks overridden.

Note this doesn't fix trace events emitted with category blink.user_timing
because some of those are visible to web content and should use overriden
time.

We're using NOPRESUBMIT here because of trace_event_common.h  I discussed
this with primiano@.

NOPRESUBMIT=true

Bug:  777763 
Change-Id: Iad104ce139a7b52c567745dc25e63745db7a3f48
Reviewed-on: https://chromium-review.googlesource.com/924032
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Reviewed-by: Primiano Tucci <primiano@chromium.org>
Reviewed-by: Fadi Meawad <fmeawad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541091}
[modify] https://crrev.com/ad6532e12c92025b6417b20b5bc0d31d385f4f2a/base/trace_event/auto_open_close_event.cc
[modify] https://crrev.com/ad6532e12c92025b6417b20b5bc0d31d385f4f2a/base/trace_event/common/trace_event_common.h
[modify] https://crrev.com/ad6532e12c92025b6417b20b5bc0d31d385f4f2a/base/trace_event/trace_event.h
[modify] https://crrev.com/ad6532e12c92025b6417b20b5bc0d31d385f4f2a/base/trace_event/trace_event_android.cc
[modify] https://crrev.com/ad6532e12c92025b6417b20b5bc0d31d385f4f2a/base/trace_event/trace_log.cc
[modify] https://crrev.com/ad6532e12c92025b6417b20b5bc0d31d385f4f2a/base/trace_event/trace_log.h
[modify] https://crrev.com/ad6532e12c92025b6417b20b5bc0d31d385f4f2a/components/tracing/child/child_trace_message_filter.cc
[modify] https://crrev.com/ad6532e12c92025b6417b20b5bc0d31d385f4f2a/content/browser/frame_host/navigator_impl.cc
[modify] https://crrev.com/ad6532e12c92025b6417b20b5bc0d31d385f4f2a/content/browser/tracing/etw_tracing_agent_win.cc
[modify] https://crrev.com/ad6532e12c92025b6417b20b5bc0d31d385f4f2a/content/browser/tracing/power_tracing_agent.cc
[modify] https://crrev.com/ad6532e12c92025b6417b20b5bc0d31d385f4f2a/content/browser/tracing/tracing_controller_impl.cc
[modify] https://crrev.com/ad6532e12c92025b6417b20b5bc0d31d385f4f2a/services/tracing/coordinator.cc
[modify] https://crrev.com/ad6532e12c92025b6417b20b5bc0d31d385f4f2a/services/tracing/public/cpp/chrome_trace_event_agent.cc
[modify] https://crrev.com/ad6532e12c92025b6417b20b5bc0d31d385f4f2a/third_party/WebKit/Source/platform/scheduler/util/tracing_helper.h

Project Member

Comment 25 by bugdroid1@chromium.org, Mar 27 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ca263da9944ccb0ee926ec688491ff99d90a6a36

commit ca263da9944ccb0ee926ec688491ff99d90a6a36
Author: Eric Seckler <eseckler@chromium.org>
Date: Tue Mar 27 19:26:50 2018

blink: Fix a virtual time deadlock situation

It's possible that we advance virtual time past the time of the next
task scheduled to execute. In that case,
AutoAdvancingVirtualTimeDomain::DelayTillNextTask should instruct the
TaskQueueManager to run the task immediately.

Bug:  777763 
Change-Id: I90a2501df05334d9971e8518717bacd9ae95693d
Reviewed-on: https://chromium-review.googlesource.com/982113
Commit-Queue: Eric Seckler <eseckler@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#546202}
[modify] https://crrev.com/ca263da9944ccb0ee926ec688491ff99d90a6a36/third_party/WebKit/Source/platform/scheduler/renderer/auto_advancing_virtual_time_domain.cc
[modify] https://crrev.com/ca263da9944ccb0ee926ec688491ff99d90a6a36/third_party/WebKit/Source/platform/scheduler/renderer/auto_advancing_virtual_time_domain_unittest.cc
[modify] https://crrev.com/ca263da9944ccb0ee926ec688491ff99d90a6a36/third_party/WebKit/Source/platform/scheduler/renderer/page_scheduler_impl_unittest.cc

Project Member

Comment 26 by bugdroid1@chromium.org, Apr 5 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/aaf006b519ccb0c73e96a296d185fa37619cc114

commit aaf006b519ccb0c73e96a296d185fa37619cc114
Author: Alex Clarke <alexclarke@chromium.org>
Date: Thu Apr 05 18:35:24 2018

Improve traceing of WebScopedVirtualTimePauser

Including a name in the trace makes it easier to diagnose bugs.

Bug:  777763 
Change-Id: I81d80b4cc0f9d71be5631575730a7ae6479b18f0
Reviewed-on: https://chromium-review.googlesource.com/977969
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548497}
[modify] https://crrev.com/aaf006b519ccb0c73e96a296d185fa37619cc114/content/renderer/dom_storage/dom_storage_cached_area.cc
[modify] https://crrev.com/aaf006b519ccb0c73e96a296d185fa37619cc114/content/renderer/dom_storage/local_storage_cached_area.cc
[modify] https://crrev.com/aaf006b519ccb0c73e96a296d185fa37619cc114/content/renderer/render_view_impl.cc
[modify] https://crrev.com/aaf006b519ccb0c73e96a296d185fa37619cc114/third_party/WebKit/Source/core/exported/LocalFrameClientImpl.cpp
[modify] https://crrev.com/aaf006b519ccb0c73e96a296d185fa37619cc114/third_party/WebKit/Source/core/frame/LocalFrame.cpp
[modify] https://crrev.com/aaf006b519ccb0c73e96a296d185fa37619cc114/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp
[modify] https://crrev.com/aaf006b519ccb0c73e96a296d185fa37619cc114/third_party/WebKit/Source/core/script/PendingScript.cpp
[modify] https://crrev.com/aaf006b519ccb0c73e96a296d185fa37619cc114/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
[modify] https://crrev.com/aaf006b519ccb0c73e96a296d185fa37619cc114/third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp
[modify] https://crrev.com/aaf006b519ccb0c73e96a296d185fa37619cc114/third_party/WebKit/Source/platform/scheduler/main_thread/frame_scheduler_impl.cc
[modify] https://crrev.com/aaf006b519ccb0c73e96a296d185fa37619cc114/third_party/WebKit/Source/platform/scheduler/main_thread/frame_scheduler_impl.h
[modify] https://crrev.com/aaf006b519ccb0c73e96a296d185fa37619cc114/third_party/WebKit/Source/platform/scheduler/main_thread/main_thread_scheduler.cc
[modify] https://crrev.com/aaf006b519ccb0c73e96a296d185fa37619cc114/third_party/WebKit/Source/platform/scheduler/main_thread/main_thread_scheduler.h
[modify] https://crrev.com/aaf006b519ccb0c73e96a296d185fa37619cc114/third_party/WebKit/Source/platform/scheduler/main_thread/main_thread_scheduler_unittest.cc
[modify] https://crrev.com/aaf006b519ccb0c73e96a296d185fa37619cc114/third_party/WebKit/Source/platform/scheduler/main_thread/page_scheduler_impl_unittest.cc
[modify] https://crrev.com/aaf006b519ccb0c73e96a296d185fa37619cc114/third_party/WebKit/Source/platform/scheduler/public/frame_scheduler.h
[modify] https://crrev.com/aaf006b519ccb0c73e96a296d185fa37619cc114/third_party/WebKit/Source/platform/scheduler/renderer/web_scoped_virtual_time_pauser.cc
[modify] https://crrev.com/aaf006b519ccb0c73e96a296d185fa37619cc114/third_party/WebKit/Source/platform/scheduler/test/fake_frame_scheduler.h
[modify] https://crrev.com/aaf006b519ccb0c73e96a296d185fa37619cc114/third_party/WebKit/Source/platform/scheduler/test/fake_renderer_scheduler.cc
[modify] https://crrev.com/aaf006b519ccb0c73e96a296d185fa37619cc114/third_party/WebKit/public/platform/WebScopedVirtualTimePauser.h
[modify] https://crrev.com/aaf006b519ccb0c73e96a296d185fa37619cc114/third_party/WebKit/public/platform/scheduler/test/fake_renderer_scheduler.h
[modify] https://crrev.com/aaf006b519ccb0c73e96a296d185fa37619cc114/third_party/WebKit/public/platform/scheduler/test/mock_renderer_scheduler.h
[modify] https://crrev.com/aaf006b519ccb0c73e96a296d185fa37619cc114/third_party/WebKit/public/platform/scheduler/web_main_thread_scheduler.h

Alex, do we need to do any more work here or can we close this bug?
Status: Closed (was: Assigned)
I don't think we need this anymore.

Sign in to add a comment