New issue
Advanced search Search tips

Issue 854083 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Jun 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

chrome.debugger "Network.emulateNetworkConditions" not throttling as expected

Reported by thomasga...@gmail.com, Jun 19 2018

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36

Steps to reproduce the problem:
 chrome.debugger.sendCommand(
            {tabId: tabID},
            "Network.emulateNetworkConditions",
            {offline: false, latency: 500, downloadThroughput:768000, uploadThroughput: 153600},
                function() {
                    console.log(`Debugger Bandwidth Set to 768000 bytes/sec`);
                    resolve();
            });

What is the expected behavior?
When you change empty the cache, then change the downloadThroughput, the same page should take a different amount of time to load.

What went wrong?
There is no change, no sensitivity to the change in downloadThroughput. There is clearly some sort of throttling going on, but it is not responsive to changes in the downloadThroughput setting.

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 67.0.3396.87  Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version:
 
Also, "Network.setCacheDisabled" does not seem to work through the extension chrome.debugger API
Labels: Needs-Triage-M67
Cc: phanindra.mandapaka@chromium.org
Components: Platform>DevTools
Labels: Triaged-ET Needs-Feedback
As per comment #0 we have tested this issue on reported chrome version 67.0.3396.87  using Windows 7.

Steps:
--------
1. Launched chrome
2. Opened Dev tools and pasted the given code in console.
We have seen error in the console.

@Reporter: As we are unable to reproduce the issue from our end. Could you please review the attached screenshot and confirm if anything being missed here and if possible provide test file.


Thanks! 
854083.PNG
22.4 KB View Download
Jeez. That was obviously just a sample. i thought you guys would have testing suites for your core extension APIs. I didn't realize I had to do it for you.

chrome.tabs.query({ active: true }, function (tabs) {
   console.log(`This is how I get the tab id {$tabs[0].id}. Wow!`);
   var tabID = tabs[0].id;
   chrome.debugger.attach({tabId:tabID}, "1.3", function() {
      if (chrome.runtime.lastError) {
         console.log(chrome.runtime.lastError.message);
         return;
      }
      chrome.debugger.sendCommand(
            {tabId: tabID},
            "Network.emulateNetworkConditions",
            {offline: false, latency: 500, downloadThroughput:768000, uploadThroughput: 153600},
                function() {
                    console.log(`Debugger Bandwidth Set to 768000 bytes/sec`);
        });
    
   });
   
});

And then open any internet page, preferably a normal heavy-ish one like https://www.theguardian.com/uk and the debugging tools and look at domcontentloaded and load event timing. Try it a few times. Then set the network throttling to the same rate (7.5 MB/s) in the devtools panel and do the same thing. The times are completely different.

Project Member

Comment 5 by sheriffbot@chromium.org, Jun 20 2018

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
There is some kind of problem with the acceptance of the commands in the debugger sendCommand API. It may be related to the recent changes made to the devtools where you allowed multiple debuggers. As I said above, "Network.emulateNetworkConditions" is not working and neither is "Network.setCacheDisabled".
And, by the way, it would be good if the chrome.debugger.sendCommand API sent some sort of confirmation in the form of a JSON object. Otherwise, you can't debug the debugger, if you see what I mean.
And, incidentally, it would make sense if the devtools panel, when you opened it after disabling the cache and throttling the network rate through the chrome.debugger.sendCommand API, showed that the cache was disabled and the network was throttled.
Status: WontFix (was: Unconfirmed)
@thomasgallagher: network domain now requires enabling before using emulateNetworkConditions, so send `Network.enable` first.
Great. Thanks for the help. I must have been reading an old version of the protocol and all the Stack Overflow stuff is now out of date. I won't make that mistake again!
Would that also explain the "Network.setCacheDisabled" command not working?

Sign in to add a comment