The following revision refers to this bug:
https://chromium.googlesource.com/chromium/src.git/+/0def2093a77f7a1f677efd941a37fdc9944f43d7
commit 0def2093a77f7a1f677efd941a37fdc9944f43d7
Author: Alex Clarke <alexclarke@chromium.org>
Date: Mon Dec 10 12:01:45 2018
ClientSocketPoolBaseTest to use MOCK_TIME
We're trying to migrate from the MessageLoop to the SequenceManager and
ClientSocketPoolBaseTest.TotalLimitCountsConnectingSockets fails on iOS
due to a quirk / feature / bug of MessagePumpIOSForIO.
MessagePumpIOSForIO isn't correctly handling SetNextDelayedDoWork
followed by a sleep and RunLoop().RunUntilIdle() properly. The problem
is upon entering the loop the MessagePumpCFRunLoopBase::PreWaitObserver
fires triggering DoIdleWork which triggers
ThreadControllerWithMessagePumpImpl to call Quit because QuitWhenIdle
has been requested. In TotalLimitCountsConnectingSockets this
manifests as a reordering of the requests (order is 1,2,3,5,4).
I intend to try and fix MessagePumpIOSForIO but in the meantime I've
opted to modernise this test, which should unblock the
SequenceManager migration.
TBR=eroman@chromium.org
Bug: 863341, 891670
Change-Id: I7cf56dfb44a2601aa0eac7334e3a89ad3707d917
Reviewed-on: https://chromium-review.googlesource.com/c/1369773
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#615094}
[modify] https://crrev.com/0def2093a77f7a1f677efd941a37fdc9944f43d7/net/socket/client_socket_pool_base_unittest.cc
The following revision refers to this bug:
https://chromium.googlesource.com/chromium/src.git/+/3ce69a991fd9ca03030738e324a1833c02462da0
commit 3ce69a991fd9ca03030738e324a1833c02462da0
Author: Sami Kyostila <skyostil@chromium.org>
Date: Wed Dec 12 18:19:13 2018
base: Don't keep running tasks after nested run loop quits on iOS
The CoreFoundation message pump (MessagePumpCFRunLoop) scheduled an extra call
to Delegate::DoWork in the following scenario:
1. Start a run loop and schedule DoWork.
2. In DoWork, start a second run nested run loop which quits immediately.
3. After the nested run loop quits, schedule another DoWork which quits the
original run loop.
After step #3, the message pump would call DoWork again because the nested
run loop triggered the execution of the nesting deferred work source.
This patch fixes the issue by checking whether the further work is allowed
before calling DoWork. Note that this check can't be done just for the nested
deferred work source, because in the flow above that source is what triggers
the call to DoWork in step #3, i.e., the run loop hasn't quit yet at that point.
The patch also includes a fix to
WebContentsViewMacInteractiveTest.SelectMenuLifetime; the test had the
following sequence in it (while a select menu is open):
1. Quit an outer run loop.
2. Post a task onto an inner run loop to continue the test.
The assumption here was that a select menu causes an inner run loop to
be active while the menu is open. This wasn't strictly correct: the
inner run loop is a native (CoreFoundation) run loop as opposed to a
base::RunLoop, which can't be explicitly exited with RunLoop::Quit().
This means that the Quit() in step #1 affects the same run loop as the
PostTask in step #2, i.e., the task is prevented from running.
This patch changes the test to only quit the test run loop after the
posted task (which closes the select menu) has run.
Bug: 891670
Change-Id: I6fe21289205664c4e1b1469547495667c753f56d
Reviewed-on: https://chromium-review.googlesource.com/c/1373754
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Sami Kyöstilä <skyostil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#615967}
[modify] https://crrev.com/3ce69a991fd9ca03030738e324a1833c02462da0/base/message_loop/message_pump_mac.mm
[modify] https://crrev.com/3ce69a991fd9ca03030738e324a1833c02462da0/base/message_loop/message_pump_unittest.cc
[modify] https://crrev.com/3ce69a991fd9ca03030738e324a1833c02462da0/chrome/browser/ui/cocoa/tab_contents/web_contents_view_mac_interactive_uitest.mm
The following revision refers to this bug:
https://chromium.googlesource.com/chromium/src.git/+/d0de086966fe7e05b6aa69d3ec69eedad2aa9e64
commit d0de086966fe7e05b6aa69d3ec69eedad2aa9e64
Author: Elly Fong-Jones <ellyjones@chromium.org>
Date: Thu Dec 13 13:45:26 2018
Revert "base: Don't keep running tasks after nested run loop quits on iOS"
This reverts commit 3ce69a991fd9ca03030738e324a1833c02462da0.
Reason for revert:
Sheriff suspects this broke a handful of menu tests on macOS 10.12:
https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Mac10.12%20Tests/17564
e.g.:
WebViewTest.TestContextMenu
Original change's description:
> base: Don't keep running tasks after nested run loop quits on iOS
>
> The CoreFoundation message pump (MessagePumpCFRunLoop) scheduled an extra call
> to Delegate::DoWork in the following scenario:
>
> 1. Start a run loop and schedule DoWork.
> 2. In DoWork, start a second run nested run loop which quits immediately.
> 3. After the nested run loop quits, schedule another DoWork which quits the
> original run loop.
>
> After step #3, the message pump would call DoWork again because the nested
> run loop triggered the execution of the nesting deferred work source.
>
> This patch fixes the issue by checking whether the further work is allowed
> before calling DoWork. Note that this check can't be done just for the nested
> deferred work source, because in the flow above that source is what triggers
> the call to DoWork in step #3, i.e., the run loop hasn't quit yet at that point.
>
> The patch also includes a fix to
> WebContentsViewMacInteractiveTest.SelectMenuLifetime; the test had the
> following sequence in it (while a select menu is open):
>
> 1. Quit an outer run loop.
> 2. Post a task onto an inner run loop to continue the test.
>
> The assumption here was that a select menu causes an inner run loop to
> be active while the menu is open. This wasn't strictly correct: the
> inner run loop is a native (CoreFoundation) run loop as opposed to a
> base::RunLoop, which can't be explicitly exited with RunLoop::Quit().
> This means that the Quit() in step #1 affects the same run loop as the
> PostTask in step #2, i.e., the task is prevented from running.
>
> This patch changes the test to only quit the test run loop after the
> posted task (which closes the select menu) has run.
>
> Bug: 891670
> Change-Id: I6fe21289205664c4e1b1469547495667c753f56d
> Reviewed-on: https://chromium-review.googlesource.com/c/1373754
> Reviewed-by: Mark Mentovai <mark@chromium.org>
> Commit-Queue: Sami Kyöstilä <skyostil@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#615967}
TBR=skyostil@chromium.org,mark@chromium.org
Change-Id: If6e3b032ae40a391df56b62ae78f0bc1ed8d93f6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 891670
Reviewed-on: https://chromium-review.googlesource.com/c/1375382
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616297}
[modify] https://crrev.com/d0de086966fe7e05b6aa69d3ec69eedad2aa9e64/base/message_loop/message_pump_mac.mm
[modify] https://crrev.com/d0de086966fe7e05b6aa69d3ec69eedad2aa9e64/base/message_loop/message_pump_unittest.cc
[modify] https://crrev.com/d0de086966fe7e05b6aa69d3ec69eedad2aa9e64/chrome/browser/ui/cocoa/tab_contents/web_contents_view_mac_interactive_uitest.mm
The following revision refers to this bug:
https://chromium.googlesource.com/chromium/src.git/+/ba5bf367eac3b25812c6e5af3c23cdc67a5b5344
commit ba5bf367eac3b25812c6e5af3c23cdc67a5b5344
Author: Sami Kyostila <skyostil@chromium.org>
Date: Thu Dec 13 17:01:43 2018
Reland "base: Don't keep running tasks after nested run loop quits on iOS"
This is a reland of 3ce69a991fd9ca03030738e324a1833c02462da0
Relanding the original patch with fixes for two WebViewTest context
menu tests. They had exactly the same problem as
WebContentsViewMacInteractiveTest: posting a task and then immediately
quitting the same run loop.
TBR=lazyboy@chromium.org
Original change's description:
> base: Don't keep running tasks after nested run loop quits on iOS
>
> The CoreFoundation message pump (MessagePumpCFRunLoop) scheduled an extra call
> to Delegate::DoWork in the following scenario:
>
> 1. Start a run loop and schedule DoWork.
> 2. In DoWork, start a second run nested run loop which quits immediately.
> 3. After the nested run loop quits, schedule another DoWork which quits the
> original run loop.
>
> After step #3, the message pump would call DoWork again because the nested
> run loop triggered the execution of the nesting deferred work source.
>
> This patch fixes the issue by checking whether the further work is allowed
> before calling DoWork. Note that this check can't be done just for the nested
> deferred work source, because in the flow above that source is what triggers
> the call to DoWork in step #3, i.e., the run loop hasn't quit yet at that point.
>
> The patch also includes a fix to
> WebContentsViewMacInteractiveTest.SelectMenuLifetime; the test had the
> following sequence in it (while a select menu is open):
>
> 1. Quit an outer run loop.
> 2. Post a task onto an inner run loop to continue the test.
>
> The assumption here was that a select menu causes an inner run loop to
> be active while the menu is open. This wasn't strictly correct: the
> inner run loop is a native (CoreFoundation) run loop as opposed to a
> base::RunLoop, which can't be explicitly exited with RunLoop::Quit().
> This means that the Quit() in step #1 affects the same run loop as the
> PostTask in step #2, i.e., the task is prevented from running.
>
> This patch changes the test to only quit the test run loop after the
> posted task (which closes the select menu) has run.
>
> Bug: 891670
> Change-Id: I6fe21289205664c4e1b1469547495667c753f56d
> Reviewed-on: https://chromium-review.googlesource.com/c/1373754
> Reviewed-by: Mark Mentovai <mark@chromium.org>
> Commit-Queue: Sami Kyöstilä <skyostil@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#615967}
Bug: 891670
Change-Id: I48a33231223b25f1d206db7e918492033d3bda13
Reviewed-on: https://chromium-review.googlesource.com/c/1375989
Commit-Queue: Sami Kyöstilä <skyostil@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616338}
[modify] https://crrev.com/ba5bf367eac3b25812c6e5af3c23cdc67a5b5344/base/message_loop/message_pump_mac.mm
[modify] https://crrev.com/ba5bf367eac3b25812c6e5af3c23cdc67a5b5344/base/message_loop/message_pump_unittest.cc
[modify] https://crrev.com/ba5bf367eac3b25812c6e5af3c23cdc67a5b5344/chrome/browser/apps/guest_view/web_view_browsertest.cc
[modify] https://crrev.com/ba5bf367eac3b25812c6e5af3c23cdc67a5b5344/chrome/browser/ui/cocoa/tab_contents/web_contents_view_mac_interactive_uitest.mm
The following revision refers to this bug:
https://chromium.googlesource.com/chromium/src.git/+/26294d4e68751e61da8a4fe5fba13b4f96855ce4
commit 26294d4e68751e61da8a4fe5fba13b4f96855ce4
Author: Javier Ernesto Flores Robles <javierrobles@chromium.org>
Date: Thu Dec 13 17:02:45 2018
Revert "base: Don't keep running tasks after nested run loop quits on iOS"
This reverts commit 3ce69a991fd9ca03030738e324a1833c02462da0.
Reason for revert: After revert of crrev.com/c/1375382 test
MessageLoopTypedTest.QuitNow/default_pump_backend_SequenceManager started to fail
on ios-simulator. See crbug.com/914842
Original change's description:
> base: Don't keep running tasks after nested run loop quits on iOS
>
> The CoreFoundation message pump (MessagePumpCFRunLoop) scheduled an extra call
> to Delegate::DoWork in the following scenario:
>
> 1. Start a run loop and schedule DoWork.
> 2. In DoWork, start a second run nested run loop which quits immediately.
> 3. After the nested run loop quits, schedule another DoWork which quits the
> original run loop.
>
> After step #3, the message pump would call DoWork again because the nested
> run loop triggered the execution of the nesting deferred work source.
>
> This patch fixes the issue by checking whether the further work is allowed
> before calling DoWork. Note that this check can't be done just for the nested
> deferred work source, because in the flow above that source is what triggers
> the call to DoWork in step #3, i.e., the run loop hasn't quit yet at that point.
>
> The patch also includes a fix to
> WebContentsViewMacInteractiveTest.SelectMenuLifetime; the test had the
> following sequence in it (while a select menu is open):
>
> 1. Quit an outer run loop.
> 2. Post a task onto an inner run loop to continue the test.
>
> The assumption here was that a select menu causes an inner run loop to
> be active while the menu is open. This wasn't strictly correct: the
> inner run loop is a native (CoreFoundation) run loop as opposed to a
> base::RunLoop, which can't be explicitly exited with RunLoop::Quit().
> This means that the Quit() in step #1 affects the same run loop as the
> PostTask in step #2, i.e., the task is prevented from running.
>
> This patch changes the test to only quit the test run loop after the
> posted task (which closes the select menu) has run.
>
> Bug: 891670
> Change-Id: I6fe21289205664c4e1b1469547495667c753f56d
> Reviewed-on: https://chromium-review.googlesource.com/c/1373754
> Reviewed-by: Mark Mentovai <mark@chromium.org>
> Commit-Queue: Sami Kyöstilä <skyostil@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#615967}
TBR=skyostil@chromium.org,mark@chromium.org
Change-Id: Ia58acd52d4b147c38c1bbaa20b0d84f85dd65ca5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 891670, 914842
Reviewed-on: https://chromium-review.googlesource.com/c/1375953
Commit-Queue: Javier Ernesto Flores Robles <javierrobles@chromium.org>
Reviewed-by: Javier Ernesto Flores Robles <javierrobles@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616339}
[modify] https://crrev.com/26294d4e68751e61da8a4fe5fba13b4f96855ce4/base/message_loop/message_pump_mac.mm
[modify] https://crrev.com/26294d4e68751e61da8a4fe5fba13b4f96855ce4/base/message_loop/message_pump_unittest.cc
[modify] https://crrev.com/26294d4e68751e61da8a4fe5fba13b4f96855ce4/chrome/browser/ui/cocoa/tab_contents/web_contents_view_mac_interactive_uitest.mm
The following revision refers to this bug:
https://chromium.googlesource.com/chromium/src.git/+/6a988bfbbdae7880bd3fba26f96c120600a76db5
commit 6a988bfbbdae7880bd3fba26f96c120600a76db5
Author: Elly Fong-Jones <ellyjones@chromium.org>
Date: Thu Dec 13 17:28:56 2018
Reland "base: Don't keep running tasks after nested run loop quits on iOS"
This reverts commit d0de086966fe7e05b6aa69d3ec69eedad2aa9e64.
Reason for revert: broke ios-simulator bots
Original change's description:
> Revert "base: Don't keep running tasks after nested run loop quits on iOS"
>
> This reverts commit 3ce69a991fd9ca03030738e324a1833c02462da0.
>
> Reason for revert:
> Sheriff suspects this broke a handful of menu tests on macOS 10.12:
>
> https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Mac10.12%20Tests/17564
>
> e.g.:
> WebViewTest.TestContextMenu
>
> Original change's description:
> > base: Don't keep running tasks after nested run loop quits on iOS
> >
> > The CoreFoundation message pump (MessagePumpCFRunLoop) scheduled an extra call
> > to Delegate::DoWork in the following scenario:
> >
> > 1. Start a run loop and schedule DoWork.
> > 2. In DoWork, start a second run nested run loop which quits immediately.
> > 3. After the nested run loop quits, schedule another DoWork which quits the
> > original run loop.
> >
> > After step #3, the message pump would call DoWork again because the nested
> > run loop triggered the execution of the nesting deferred work source.
> >
> > This patch fixes the issue by checking whether the further work is allowed
> > before calling DoWork. Note that this check can't be done just for the nested
> > deferred work source, because in the flow above that source is what triggers
> > the call to DoWork in step #3, i.e., the run loop hasn't quit yet at that point.
> >
> > The patch also includes a fix to
> > WebContentsViewMacInteractiveTest.SelectMenuLifetime; the test had the
> > following sequence in it (while a select menu is open):
> >
> > 1. Quit an outer run loop.
> > 2. Post a task onto an inner run loop to continue the test.
> >
> > The assumption here was that a select menu causes an inner run loop to
> > be active while the menu is open. This wasn't strictly correct: the
> > inner run loop is a native (CoreFoundation) run loop as opposed to a
> > base::RunLoop, which can't be explicitly exited with RunLoop::Quit().
> > This means that the Quit() in step #1 affects the same run loop as the
> > PostTask in step #2, i.e., the task is prevented from running.
> >
> > This patch changes the test to only quit the test run loop after the
> > posted task (which closes the select menu) has run.
> >
> > Bug: 891670
> > Change-Id: I6fe21289205664c4e1b1469547495667c753f56d
> > Reviewed-on: https://chromium-review.googlesource.com/c/1373754
> > Reviewed-by: Mark Mentovai <mark@chromium.org>
> > Commit-Queue: Sami Kyöstilä <skyostil@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#615967}
>
> TBR=skyostil@chromium.org,mark@chromium.org
>
> Change-Id: If6e3b032ae40a391df56b62ae78f0bc1ed8d93f6
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 891670
> Reviewed-on: https://chromium-review.googlesource.com/c/1375382
> Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
> Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#616297}
TBR=ellyjones@chromium.org,skyostil@chromium.org,mark@chromium.org
Change-Id: I68d7b4687fd1f2a4906961f55b31038199089ff3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 891670
Reviewed-on: https://chromium-review.googlesource.com/c/1376249
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616350}
[modify] https://crrev.com/6a988bfbbdae7880bd3fba26f96c120600a76db5/base/message_loop/message_pump_mac.mm
[modify] https://crrev.com/6a988bfbbdae7880bd3fba26f96c120600a76db5/base/message_loop/message_pump_unittest.cc
[modify] https://crrev.com/6a988bfbbdae7880bd3fba26f96c120600a76db5/chrome/browser/ui/cocoa/tab_contents/web_contents_view_mac_interactive_uitest.mm
The following revision refers to this bug:
https://chromium.googlesource.com/chromium/src.git/+/5f534197944cdb2e4947e9aca7ceaee68ee3608d
commit 5f534197944cdb2e4947e9aca7ceaee68ee3608d
Author: Elly Fong-Jones <ellyjones@chromium.org>
Date: Thu Dec 13 17:30:23 2018
Revert "Reland "base: Don't keep running tasks after nested run loop quits on iOS""
This reverts commit 6a988bfbbdae7880bd3fba26f96c120600a76db5.
Reason for revert: should not have relanded
Original change's description:
> Reland "base: Don't keep running tasks after nested run loop quits on iOS"
>
> This reverts commit d0de086966fe7e05b6aa69d3ec69eedad2aa9e64.
>
> Reason for revert: broke ios-simulator bots
>
> Original change's description:
> > Revert "base: Don't keep running tasks after nested run loop quits on iOS"
> >
> > This reverts commit 3ce69a991fd9ca03030738e324a1833c02462da0.
> >
> > Reason for revert:
> > Sheriff suspects this broke a handful of menu tests on macOS 10.12:
> >
> > https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Mac10.12%20Tests/17564
> >
> > e.g.:
> > WebViewTest.TestContextMenu
> >
> > Original change's description:
> > > base: Don't keep running tasks after nested run loop quits on iOS
> > >
> > > The CoreFoundation message pump (MessagePumpCFRunLoop) scheduled an extra call
> > > to Delegate::DoWork in the following scenario:
> > >
> > > 1. Start a run loop and schedule DoWork.
> > > 2. In DoWork, start a second run nested run loop which quits immediately.
> > > 3. After the nested run loop quits, schedule another DoWork which quits the
> > > original run loop.
> > >
> > > After step #3, the message pump would call DoWork again because the nested
> > > run loop triggered the execution of the nesting deferred work source.
> > >
> > > This patch fixes the issue by checking whether the further work is allowed
> > > before calling DoWork. Note that this check can't be done just for the nested
> > > deferred work source, because in the flow above that source is what triggers
> > > the call to DoWork in step #3, i.e., the run loop hasn't quit yet at that point.
> > >
> > > The patch also includes a fix to
> > > WebContentsViewMacInteractiveTest.SelectMenuLifetime; the test had the
> > > following sequence in it (while a select menu is open):
> > >
> > > 1. Quit an outer run loop.
> > > 2. Post a task onto an inner run loop to continue the test.
> > >
> > > The assumption here was that a select menu causes an inner run loop to
> > > be active while the menu is open. This wasn't strictly correct: the
> > > inner run loop is a native (CoreFoundation) run loop as opposed to a
> > > base::RunLoop, which can't be explicitly exited with RunLoop::Quit().
> > > This means that the Quit() in step #1 affects the same run loop as the
> > > PostTask in step #2, i.e., the task is prevented from running.
> > >
> > > This patch changes the test to only quit the test run loop after the
> > > posted task (which closes the select menu) has run.
> > >
> > > Bug: 891670
> > > Change-Id: I6fe21289205664c4e1b1469547495667c753f56d
> > > Reviewed-on: https://chromium-review.googlesource.com/c/1373754
> > > Reviewed-by: Mark Mentovai <mark@chromium.org>
> > > Commit-Queue: Sami Kyöstilä <skyostil@chromium.org>
> > > Cr-Commit-Position: refs/heads/master@{#615967}
> >
> > TBR=skyostil@chromium.org,mark@chromium.org
> >
> > Change-Id: If6e3b032ae40a391df56b62ae78f0bc1ed8d93f6
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: 891670
> > Reviewed-on: https://chromium-review.googlesource.com/c/1375382
> > Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
> > Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#616297}
>
> TBR=ellyjones@chromium.org,skyostil@chromium.org,mark@chromium.org
>
> Change-Id: I68d7b4687fd1f2a4906961f55b31038199089ff3
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 891670
> Reviewed-on: https://chromium-review.googlesource.com/c/1376249
> Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
> Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#616350}
TBR=ellyjones@chromium.org,skyostil@chromium.org,mark@chromium.org
Change-Id: Ia05259cd2f2d60b41efdc7b73702da865680c1a3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 891670
Reviewed-on: https://chromium-review.googlesource.com/c/1376250
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616352}
[modify] https://crrev.com/5f534197944cdb2e4947e9aca7ceaee68ee3608d/base/message_loop/message_pump_mac.mm
[modify] https://crrev.com/5f534197944cdb2e4947e9aca7ceaee68ee3608d/base/message_loop/message_pump_unittest.cc
[modify] https://crrev.com/5f534197944cdb2e4947e9aca7ceaee68ee3608d/chrome/browser/ui/cocoa/tab_contents/web_contents_view_mac_interactive_uitest.mm
The following revision refers to this bug:
https://chromium.googlesource.com/chromium/src.git/+/37ba0abde9593363228368601c9e1adf44544c0f
commit 37ba0abde9593363228368601c9e1adf44544c0f
Author: Rohit Rao <rohitrao@chromium.org>
Date: Thu Dec 13 20:45:56 2018
Reland "Reland "base: Don't keep running tasks after nested run loop quits on iOS""
This reverts commit 5f534197944cdb2e4947e9aca7ceaee68ee3608d.
Reason for revert: This CL needs to be in the tree to keep ios-simulator green.
Original change's description:
> Revert "Reland "base: Don't keep running tasks after nested run loop quits on iOS""
>
> This reverts commit 6a988bfbbdae7880bd3fba26f96c120600a76db5.
>
> Reason for revert: should not have relanded
>
> Original change's description:
> > Reland "base: Don't keep running tasks after nested run loop quits on iOS"
> >
> > This reverts commit d0de086966fe7e05b6aa69d3ec69eedad2aa9e64.
> >
> > Reason for revert: broke ios-simulator bots
> >
> > Original change's description:
> > > Revert "base: Don't keep running tasks after nested run loop quits on iOS"
> > >
> > > This reverts commit 3ce69a991fd9ca03030738e324a1833c02462da0.
> > >
> > > Reason for revert:
> > > Sheriff suspects this broke a handful of menu tests on macOS 10.12:
> > >
> > > https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Mac10.12%20Tests/17564
> > >
> > > e.g.:
> > > WebViewTest.TestContextMenu
> > >
> > > Original change's description:
> > > > base: Don't keep running tasks after nested run loop quits on iOS
> > > >
> > > > The CoreFoundation message pump (MessagePumpCFRunLoop) scheduled an extra call
> > > > to Delegate::DoWork in the following scenario:
> > > >
> > > > 1. Start a run loop and schedule DoWork.
> > > > 2. In DoWork, start a second run nested run loop which quits immediately.
> > > > 3. After the nested run loop quits, schedule another DoWork which quits the
> > > > original run loop.
> > > >
> > > > After step #3, the message pump would call DoWork again because the nested
> > > > run loop triggered the execution of the nesting deferred work source.
> > > >
> > > > This patch fixes the issue by checking whether the further work is allowed
> > > > before calling DoWork. Note that this check can't be done just for the nested
> > > > deferred work source, because in the flow above that source is what triggers
> > > > the call to DoWork in step #3, i.e., the run loop hasn't quit yet at that point.
> > > >
> > > > The patch also includes a fix to
> > > > WebContentsViewMacInteractiveTest.SelectMenuLifetime; the test had the
> > > > following sequence in it (while a select menu is open):
> > > >
> > > > 1. Quit an outer run loop.
> > > > 2. Post a task onto an inner run loop to continue the test.
> > > >
> > > > The assumption here was that a select menu causes an inner run loop to
> > > > be active while the menu is open. This wasn't strictly correct: the
> > > > inner run loop is a native (CoreFoundation) run loop as opposed to a
> > > > base::RunLoop, which can't be explicitly exited with RunLoop::Quit().
> > > > This means that the Quit() in step #1 affects the same run loop as the
> > > > PostTask in step #2, i.e., the task is prevented from running.
> > > >
> > > > This patch changes the test to only quit the test run loop after the
> > > > posted task (which closes the select menu) has run.
> > > >
> > > > Bug: 891670
> > > > Change-Id: I6fe21289205664c4e1b1469547495667c753f56d
> > > > Reviewed-on: https://chromium-review.googlesource.com/c/1373754
> > > > Reviewed-by: Mark Mentovai <mark@chromium.org>
> > > > Commit-Queue: Sami Kyöstilä <skyostil@chromium.org>
> > > > Cr-Commit-Position: refs/heads/master@{#615967}
> > >
> > > TBR=skyostil@chromium.org,mark@chromium.org
> > >
> > > Change-Id: If6e3b032ae40a391df56b62ae78f0bc1ed8d93f6
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Bug: 891670
> > > Reviewed-on: https://chromium-review.googlesource.com/c/1375382
> > > Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
> > > Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
> > > Cr-Commit-Position: refs/heads/master@{#616297}
> >
> > TBR=ellyjones@chromium.org,skyostil@chromium.org,mark@chromium.org
> >
> > Change-Id: I68d7b4687fd1f2a4906961f55b31038199089ff3
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: 891670
> > Reviewed-on: https://chromium-review.googlesource.com/c/1376249
> > Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
> > Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#616350}
>
> TBR=ellyjones@chromium.org,skyostil@chromium.org,mark@chromium.org
>
> Change-Id: Ia05259cd2f2d60b41efdc7b73702da865680c1a3
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 891670
> Reviewed-on: https://chromium-review.googlesource.com/c/1376250
> Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
> Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#616352}
TBR=ellyjones@chromium.org,skyostil@chromium.org,mark@chromium.org
Change-Id: Ife24296aec35ef48231e2ae9f632898de8085d64
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 891670
Reviewed-on: https://chromium-review.googlesource.com/c/1376734
Reviewed-by: Rohit Rao <rohitrao@chromium.org>
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616421}
[modify] https://crrev.com/37ba0abde9593363228368601c9e1adf44544c0f/base/message_loop/message_pump_mac.mm
[modify] https://crrev.com/37ba0abde9593363228368601c9e1adf44544c0f/base/message_loop/message_pump_unittest.cc
[modify] https://crrev.com/37ba0abde9593363228368601c9e1adf44544c0f/chrome/browser/ui/cocoa/tab_contents/web_contents_view_mac_interactive_uitest.mm