Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 29367181: Issue 4726 - Add tests for the element hiding emulation content script (Closed)

Created:
Dec. 11, 2016, 11:44 a.m. by Felix Dahlke
Modified:
Jan. 19, 2017, 2:08 p.m.
Reviewers:
kzar
CC:
Wladimir Palant, Sebastian Noack
Base URL:
https://bitbucket.org/fhd/adblockpluscore
Visibility:
Public.

Description

Issue 4726 - Add tests for the element hiding emulation content script

Patch Set 1 : #

Total comments: 1

Patch Set 2 : Rebased on master, added tests for braces in regexp property selectors #

Total comments: 51

Patch Set 3 : Run browser tests via our test runner #

Patch Set 4 : Add license header #

Total comments: 11

Patch Set 5 : Addressed remaining comments #

Total comments: 8

Patch Set 6 : Wrap and indent QUnit.test invocations consistently #

Unified diffs Side-by-side diffs Delta from patch set Stats (+297 lines, -11 lines) Patch
M README.md View 1 2 3 4 1 chunk +19 lines, -3 lines 0 comments Download
M chrome/content/elemHideEmulation.js View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
M lib/common.js View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
M package.json View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
A test/browser/elemHideEmulation.html View 1 2 3 4 1 chunk +16 lines, -0 lines 0 comments Download
A test/browser/elemHideEmulation.js View 1 2 3 4 5 1 chunk +229 lines, -0 lines 0 comments Download
M test_runner.js View 1 2 3 4 1 chunk +23 lines, -6 lines 0 comments Download

Messages

Total messages: 19
Felix Dahlke
https://codereview.adblockplus.org/29367181/diff/29367222/test/browser/elemHideEmulation.js File test/browser/elemHideEmulation.js (right): https://codereview.adblockplus.org/29367181/diff/29367222/test/browser/elemHideEmulation.js#newcode106 test/browser/elemHideEmulation.js:106: function() Not so sure about this indentation style - ...
Dec. 11, 2016, 12:13 p.m. (2016-12-11 12:13:50 UTC) #1
Felix Dahlke
Rebased, new patch set is up.
Dec. 13, 2016, 5:27 p.m. (2016-12-13 17:27:05 UTC) #2
kzar
Cool idea, I like how the tests will still run from the command line with ...
Jan. 9, 2017, 8:28 a.m. (2017-01-09 08:28:43 UTC) #3
Felix Dahlke
Added patch sets 3 and 4 - and a whole lot of responses :) https://codereview.adblockplus.org/29367181/diff/29367382/README.md ...
Jan. 10, 2017, 9:16 a.m. (2017-01-10 09:16:49 UTC) #4
kzar
https://codereview.adblockplus.org/29367181/diff/29367382/README.md File README.md (right): https://codereview.adblockplus.org/29367181/diff/29367382/README.md#newcode12 README.md:12: ### Requirements On 2017/01/10 09:16:47, Felix Dahlke wrote: > ...
Jan. 10, 2017, 11:05 a.m. (2017-01-10 11:05:34 UTC) #5
Felix Dahlke
https://codereview.adblockplus.org/29367181/diff/29367382/package.json File package.json (right): https://codereview.adblockplus.org/29367181/diff/29367382/package.json#newcode7 package.json:7: "node-qunit-phantomjs": "^1.5.0", On 2017/01/10 11:05:33, kzar wrote: > On ...
Jan. 10, 2017, 1:27 p.m. (2017-01-10 13:27:32 UTC) #6
kzar
https://codereview.adblockplus.org/29367181/diff/29367382/package.json File package.json (right): https://codereview.adblockplus.org/29367181/diff/29367382/package.json#newcode7 package.json:7: "node-qunit-phantomjs": "^1.5.0", On 2017/01/10 13:27:32, Felix Dahlke wrote: > ...
Jan. 11, 2017, 4:25 a.m. (2017-01-11 04:25:29 UTC) #7
Felix Dahlke
No new patch sets at this point although there are comments which I want to ...
Jan. 11, 2017, 10:06 a.m. (2017-01-11 10:06:03 UTC) #8
kzar
https://codereview.adblockplus.org/29367181/diff/29367382/test/browser/elemHideEmulation.js File test/browser/elemHideEmulation.js (right): https://codereview.adblockplus.org/29367181/diff/29367382/test/browser/elemHideEmulation.js#newcode24 test/browser/elemHideEmulation.js:24: for (var i = 0; i < styleElements.length; i++) ...
Jan. 11, 2017, 11:19 a.m. (2017-01-11 11:19:19 UTC) #9
Felix Dahlke
https://codereview.adblockplus.org/29367181/diff/29367382/test/browser/elemHideEmulation.js File test/browser/elemHideEmulation.js (right): https://codereview.adblockplus.org/29367181/diff/29367382/test/browser/elemHideEmulation.js#newcode24 test/browser/elemHideEmulation.js:24: for (var i = 0; i < styleElements.length; i++) ...
Jan. 12, 2017, 9:24 a.m. (2017-01-12 09:24:07 UTC) #10
kzar
Mind commenting on the indentation discussion in test/browser/elemHideEmulation.js line 105 Sebastian? I don't have much ...
Jan. 12, 2017, 9:42 a.m. (2017-01-12 09:42:13 UTC) #11
Sebastian Noack
https://codereview.adblockplus.org/29367181/diff/29367382/test/browser/elemHideEmulation.js File test/browser/elemHideEmulation.js (right): https://codereview.adblockplus.org/29367181/diff/29367382/test/browser/elemHideEmulation.js#newcode105 test/browser/elemHideEmulation.js:105: applyElemHideEmulation(["[-abp-properties='background-color: rgb(0, 0, 0)']"], On 2017/01/12 09:42:13, kzar wrote: ...
Jan. 12, 2017, 11:12 p.m. (2017-01-12 23:12:58 UTC) #12
Felix Dahlke
Rename browser test runner, address code style comments
Jan. 17, 2017, 7:36 p.m. (2017-01-17 19:36:12 UTC) #13
Felix Dahlke
Address remaining comments
Jan. 17, 2017, 7:39 p.m. (2017-01-17 19:39:31 UTC) #14
Felix Dahlke
Patch set 5 is up, I think I've got everything now! https://codereview.adblockplus.org/29367181/diff/29367382/test/browser/elemHideEmulation.js File test/browser/elemHideEmulation.js (right): ...
Jan. 17, 2017, 7:41 p.m. (2017-01-17 19:41:09 UTC) #15
kzar
https://codereview.adblockplus.org/29367181/diff/29370964/README.md File README.md (right): https://codereview.adblockplus.org/29367181/diff/29370964/README.md#newcode26 README.md:26: `npm test test/synchronizer.js`. On 2017/01/17 19:41:08, Felix Dahlke wrote: ...
Jan. 18, 2017, 4:17 a.m. (2017-01-18 04:17:15 UTC) #16
Felix Dahlke
Patch set 6 is up! https://codereview.adblockplus.org/29367181/diff/29372245/chrome/content/elemHideEmulation.js File chrome/content/elemHideEmulation.js (right): https://codereview.adblockplus.org/29367181/diff/29372245/chrome/content/elemHideEmulation.js#newcode1 chrome/content/elemHideEmulation.js:1: // We are currently ...
Jan. 19, 2017, 9:56 a.m. (2017-01-19 09:56:51 UTC) #17
kzar
LGTM
Jan. 19, 2017, 9:59 a.m. (2017-01-19 09:59:41 UTC) #18
Sebastian Noack
Jan. 19, 2017, 10:13 a.m. (2017-01-19 10:13:01 UTC) #19
(Moving myself back to CC)

https://codereview.adblockplus.org/29367181/diff/29372245/test/browser/elemHi...
File test/browser/elemHideEmulation.js (right):

https://codereview.adblockplus.org/29367181/diff/29372245/test/browser/elemHi...
test/browser/elemHideEmulation.js:127:
applyElemHideEmulation(["[-abp-properties='background-color: rgb(0, 0, 0)']"],
On 2017/01/19 09:56:51, Felix Dahlke wrote:
> On 2017/01/18 04:17:15, kzar wrote:
> > Mind also moving the first argument of the applyElemHideemulation calls down
> in
> > line with the second?
> > 
> > applyElemHideEmulation(
> >   ["[-abp-properties='background-color: rgb(0, 0, 0)']"],
> >   function()
> >   {
> >     ...
> >   }
> > );
> > 
> > (That's generally how we do it, also it is nice to make the indentation
> > consistent between the test cases.)
> 
> I think there's a range of how we generally do this, but if you find this more
> readable (makes no relevant difference for me), I'll change it. Done.

I agree with Dave. As I explained in my previous comment, it is harder to read
if the arguments are not aligned.

https://codereview.adblockplus.org/29367181/diff/29372245/test/browser/elemHi...
test/browser/elemHideEmulation.js:136: QUnit.test("Property selector with
wildcard", function(assert)
On 2017/01/19 09:56:51, Felix Dahlke wrote:
> On 2017/01/18 04:17:15, kzar wrote:
> > Mind bringing the function call and test description down onto the next
line?
> > That will make how the test case functions are indented consistent and as
> > mentioned above that's generally how we do it. It's kind of unusual IMO to
mix
> > both styles of indentation.
> > 
> > So like
> > 
> > QUnit.test(
> >   "Property selector with wildcard",
> >   function(assert)
> >   {
> >     ...
> >   }
> > );
> 
> There's no need for the wrapping in these cases, and I don't think we
generally
> wrap lines that don't have to be wrapped.
> 
> IMO it hurts readability, but since I wrote it and you're reading it, you're
the
> better judge of that. Done. (On the positive side, it does resolve the
> blame/diff issues I mentioned.)

FWIW, if all arguments fit on the same line as the function call, like here, I
generally wouldn't wrap it. Here, one might argue though that it's more
consistent to wrap all tests in the same way. I don't have a strong opinion.

Powered by Google App Engine
This is Rietveld