Bug 163902 - Add support for introducing simulated latency in network process
Summary: Add support for introducing simulated latency in network process
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-24 11:09 PDT by Antti Koivisto
Modified: 2016-10-25 01:27 PDT (History)
5 users (show)

See Also:


Attachments
patch (11.04 KB, patch)
2016-10-24 11:26 PDT, Antti Koivisto
achristensen: review+
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews104 for mac-yosemite-wk2 (1.36 MB, application/zip)
2016-10-24 12:34 PDT, Build Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 2016-10-24 11:09:50 PDT
For testing purposes.
Comment 1 Antti Koivisto 2016-10-24 11:26:19 PDT
Created attachment 292632 [details]
patch
Comment 2 Alex Christensen 2016-10-24 11:35:41 PDT
Comment on attachment 292632 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=292632&action=review

> Source/WebKit2/NetworkProcess/NetworkLoad.cpp:298
> +void NetworkLoad::notifyDidReceiveResponse(ResourceResponse&& response, ResponseCompletionHandler&& completionHandler)

Let's just put this in didReceiveResponseNetworkSession with an if statement.

> Source/WebKit2/NetworkProcess/NetworkLoad.cpp:327
>  void NetworkLoad::didCompleteWithError(const ResourceError& error)
>  {
> +    if (m_throttle) {
> +        m_throttle->completionError = error;
> +        return;
> +    }

What if there's an error before we receive the response?
Comment 3 Build Bot 2016-10-24 12:34:52 PDT
Comment on attachment 292632 [details]
patch

Attachment 292632 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/2359972

New failing tests:
svg/wicd/test-rightsizing-b.xhtml
Comment 4 Build Bot 2016-10-24 12:34:55 PDT
Created attachment 292642 [details]
Archive of layout-test-results from ews104 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 5 Antti Koivisto 2016-10-24 12:37:58 PDT
> > +void NetworkLoad::notifyDidReceiveResponse(ResourceResponse&& response, ResponseCompletionHandler&& completionHandler)
> 
> Let's just put this in didReceiveResponseNetworkSession with an if statement.

This the part of didReceiveResponseNetworkSession that is also called from timer completion function. It would be awkward to know whether initialize throttling without the split.

> What if there's an error before we receive the response?

It does not get throttled. I suppose it could be though it doesn't seem super important.
Comment 6 Antti Koivisto 2016-10-24 12:39:21 PDT
Test failures are flakes.
Comment 7 Antti Koivisto 2016-10-25 01:27:26 PDT
https://trac.webkit.org/r207812 (With some cleanups. Turns out just delaying response is enough as data/didComplete are blocked by not calling the completion handler).