Extensions API: chrome.downloads.search filter is buggy
Reported by
hrg....@gmail.com,
Jun 5 2016
|
||||||
Issue description
Chrome Version : 49.0.2623.112 (Official Build) m (32-bit)
OS Version: 6.0 (Windows Vista, Windows Server 2008)
What steps will reproduce the problem?
1. Create an extension with the "downloads" permission
2. Inside the extension run any of the following lines:
chrome.downloads.search({totalBytesGreater:10000},list=>console.log(list))
chrome.downloads.search({totalBytesLess:10000},list=>console.log(list))
chrome.downloads.search({startedAfter:+new Date-60*1000+''},list=>console.log(list))
chrome.downloads.search({startedBefore:+new Date+''},list=>console.log(list))
What is the expected result?
First line: An array with downloads bigger than 10000 bytes
Second line: An array with downloads smaller than 10000 bytes
Third line: An array with doanloads started in the last minute
Fourth line: An array with downloads started before now (i.e. all of them)
What happens instead?
First line: "Uncaught Error: Invalid value for argument 1"
Second line: "Uncaught Error: Invalid value for argument 1"
Third line: An array with all downloads ever made
Fourth line: An empty array
,
Jun 6 2016
,
Jun 6 2016
No problem. File attached. It's an unpacked extension. Once loaded, inspect with DevTools the background page and you'll see the output in the console.
,
Jun 7 2016
Thank you for providing more feedback. Adding requester "tkonchada@chromium.org" for another review and adding "Needs-Review" label for tracking. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jun 7 2016
,
Jun 27 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/a61f420b0706b67e305cd98d0f59da32d81d0cc0 commit a61f420b0706b67e305cd98d0f59da32d81d0cc0 Author: lazyboy <lazyboy@chromium.org> Date: Mon Jun 27 23:48:18 2016 downloads.query: parse numerical query properties as double, not int. In r244404, we changed these from ints to doubles. However, we still seem to parse these through Value::GetAsInteger. This always fails. Change it to use Value::GetAsDouble instead. BUG= 617435 Test=See bug description for repro test case. Review-Url: https://codereview.chromium.org/2092963002 Cr-Commit-Position: refs/heads/master@{#402332} [modify] https://crrev.com/a61f420b0706b67e305cd98d0f59da32d81d0cc0/chrome/browser/download/download_query.cc [modify] https://crrev.com/a61f420b0706b67e305cd98d0f59da32d81d0cc0/chrome/browser/download/download_query.h [modify] https://crrev.com/a61f420b0706b67e305cd98d0f59da32d81d0cc0/chrome/browser/download/download_query_unittest.cc [add] https://crrev.com/a61f420b0706b67e305cd98d0f59da32d81d0cc0/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc [modify] https://crrev.com/a61f420b0706b67e305cd98d0f59da32d81d0cc0/chrome/chrome_tests_unit.gypi
,
Jun 27 2016
,
Jun 28 2016
Tested the same on win8.1 chrome version 53.0.2782.0 and observed 4 arrays without any errors Please find the screenshot Fix works as expected
,
Jun 28 2016
Keep in mind, though, that this bug is not just about errors being thrown. For the 3rd and 4th line in the test case, they don't throw any errors but rather their result is wrong. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by tkonch...@chromium.org
, Jun 6 2016