Closed Bug 1256796 Opened 4 years ago Closed 3 years ago

[ESLint] Fix ESLint issues in devtools/client/webconsole/test/browser_console_variables_view_dom_nodes.js

Categories

(DevTools :: Console, defect, P3)

defect

Tracking

(firefox52 fixed)

RESOLVED FIXED
Firefox 52
Tracking Status
firefox52 --- fixed

People

(Reporter: linclark, Unassigned, Mentored)

References

Details

(Whiteboard: [btpp-backlog])

Attachments

(1 file, 2 obsolete files)

If you haven’t contributed to Firefox before, follow the steps here to set up your environment: https://developer.mozilla.org/en-US/docs/Tools/Contributing#Getting_set_up

Then, automatically configure ESLint to work with the Firefox specific rules by following the instructions here: https://wiki.mozilla.org/DevTools/CodingStandards

Then you can see the issues that need to be fixed by running

> eslint --no-ignore devtools/client/webconsole/test/browser_console_variables_view_dom_nodes.js
Blocks: 1256948
Priority: -- → P3
Whiteboard: [btpp-backlog]
Attached patch 1256796.diff (obsolete) — Splinter Review
I am totally new to firefox dev, so please forgive any coding standards deviations.

After the patch:

$ ./mach eslint --no-ignore  devtools/client/webconsole/test/browser_console_variables_view_dom_nodes.js
✖ 0 problems (0 errors, 0 warnings)


$ ./mach test devtools/client/webconsole/test/browser_console_variables_view_dom_nodes.js

######
### Now running mochitest-browser with subsuite devtools.
######

Checking for orphan ssltunnel processes...
Checking for orphan xpcshell processes...
SUITE-START | Running 1 tests
mozprofile.addons WARNING | Could not install /home/vag/projects/gecko-dev/obj-x86_64-pc-linux-gnu/_tests/testing/mochitest/extensions/mozscreenshots: [Errno 2] No such file or directory: '/home/vag/projects/gecko-dev/obj-x86_64-pc-linux-gnu/_tests/testing/mochitest/extensions/mozscreenshots/install.rdf'
dir: devtools/client/webconsole/test
pk12util: PKCS12 IMPORT SUCCESSFUL
MochitestServer : launching [u'/home/vag/projects/gecko-dev/obj-x86_64-pc-linux-gnu/dist/bin/xpcshell', '-g', u'/home/vag/projects/gecko-dev/obj-x86_64-pc-linux-gnu/dist/bin', '-v', '170', '-f', u'/home/vag/projects/gecko-dev/obj-x86_64-pc-linux-gnu/dist/bin/components/httpd.js', '-e', "const _PROFILE_PATH = '/tmp/tmpvyegEW.mozrunner'; const _SERVER_PORT = '8888'; const _SERVER_ADDR = '127.0.0.1'; const _TEST_PREFIX = undefined; const _DISPLAY_RESULTS = false;", '-f', '/home/vag/projects/gecko-dev/obj-x86_64-pc-linux-gnu/_tests/testing/mochitest/server.js']
runtests.py | Server pid: 4394
runtests.py | Websocket server pid: 4397
runtests.py | SSL tunnel pid: 4401
runtests.py | Running with e10s: True
runtests.py | Running tests: start.

Application command: /home/vag/projects/gecko-dev/obj-x86_64-pc-linux-gnu/dist/bin/firefox -marionette -foreground -profile /tmp/tmpvyegEW.mozrunner
runtests.py | Application pid: 4423
TEST-INFO | started process Main app process
ATTENTION: default value of option force_s3tc_enable overridden by environment.
ATTENTION: default value of option force_s3tc_enable overridden by environment.
1475135091104	Marionette	INFO	Listening on port 2828
ATTENTION: default value of option force_s3tc_enable overridden by environment.
0 INFO *** Start BrowserChrome Test Results ***
1 INFO checking window state
2 INFO TEST-START | devtools/client/webconsole/test/browser_console_variables_view_dom_nodes.js
3 INFO Console message: [JavaScript Warning: "Use of nsIFile in content process is deprecated." {file: "resource://gre/modules/NetUtil.jsm" line: 304}]
4 INFO Console message: [JavaScript Warning: "Use of nsIFile in content process is deprecated." {file: "resource://gre/modules/NetUtil.jsm" line: 304}]
5 INFO Console message: [JavaScript Warning: "Use of nsIFile in content process is deprecated." {file: "resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/gcli/source/lib/gcli/util/filesystem.js" line: 40}]
6 INFO TEST-PASS | devtools/client/webconsole/test/browser_console_variables_view_dom_nodes.js | Variables view opened - 
7 INFO TEST-PASS | devtools/client/webconsole/test/browser_console_variables_view_dom_nodes.js | rule 0 matched for property 0 - 
8 INFO TEST-PASS | devtools/client/webconsole/test/browser_console_variables_view_dom_nodes.js | rule 1 matched for property 1 - 
9 INFO TEST-PASS | devtools/client/webconsole/test/browser_console_variables_view_dom_nodes.js | rule 2 matched for property 2 - 
10 INFO TEST-PASS | devtools/client/webconsole/test/browser_console_variables_view_dom_nodes.js | rule 3 matched for property 3 - 
11 INFO TEST-PASS | devtools/client/webconsole/test/browser_console_variables_view_dom_nodes.js | rule 4 matched for property 4 - 
12 INFO TEST-PASS | devtools/client/webconsole/test/browser_console_variables_view_dom_nodes.js | rule 5 matched for property 5 - 
13 INFO TEST-PASS | devtools/client/webconsole/test/browser_console_variables_view_dom_nodes.js | rule 6 matched for property 6 - 
14 INFO TEST-PASS | devtools/client/webconsole/test/browser_console_variables_view_dom_nodes.js | rule 7 matched for property 7 - 
15 INFO TEST-PASS | devtools/client/webconsole/test/browser_console_variables_view_dom_nodes.js | rule 8 matched for property 8 - 
16 INFO Removing tab.
17 INFO Waiting for event: 'TabClose' on [object XULElement].
18 INFO Got event: 'TabClose' on [object XULElement].
19 INFO Tab removed and finished closing
MEMORY STAT vsizeMaxContiguous not supported in this build configuration.
MEMORY STAT | vsize 1152MB | residentFast 353MB | heapAllocated 201MB
20 INFO TEST-OK | devtools/client/webconsole/test/browser_console_variables_view_dom_nodes.js | took 2643ms
21 INFO checking window state
Completed ShutdownLeaks collections in process 4489
Completed ShutdownLeaks collections in process 4423
22 INFO TEST-START | Shutdown
23 INFO Browser Chrome Test Summary
24 INFO Passed:  10
25 INFO Failed:  0
26 INFO Todo:    0
27 INFO Mode:    e10s
28 INFO *** End BrowserChrome Test Results ***
TEST-INFO | Main app process: exit 0
runtests.py | Application ran for: 0:00:11.224089
zombiecheck | Reading PID log: /tmp/tmp8TxERbpidlog
==> process 4423 launched child process 4447
==> process 4423 launched child process 4489
zombiecheck | Checking for orphan process with PID: 4447
zombiecheck | Checking for orphan process with PID: 4489
Stopping web server
Stopping web socket server
Stopping ssltunnel
WARNING | leakcheck | refcount logging is off, so leaks can't be detected!
runtests.py | Running tests: end.
TEST-INFO | checking window state
Browser Chrome Test Summary
	Passed: 10
	Failed: 0
	Todo: 0
	Mode: e10s
*** End BrowserChrome Test Results ***
SUITE-END | took 12s
Attachment #8796052 - Flags: review+
Attachment #8796052 - Flags: review+ → review?(lclark)
Comment on attachment 8796052 [details] [diff] [review]
1256796.diff

Review of attachment 8796052 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks for the patch!

Overall it looks good. I just have suggestion... For the string, I'd suggest switching to a template literal. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals. You can see an example here: https://dxr.mozilla.org/mozilla-central/source/devtools/client/inspector/rules/test/browser_rules_search-filter-computed-list_02.js#12
Attachment #8796052 - Flags: review?(lclark)
Attached patch 1256796.1.diff (obsolete) — Splinter Review
Thanks for the feedback! Changed accordingly

Again, passed eslint & test.

$ ./mach eslint --no-ignore  devtools/client/webconsole/test/browser_console_variables_view_dom_nodes.js
✖ 0 problems (0 errors, 0 warnings)

$ ./mach test devtools/client/webconsole/test/browser_console_variables_view_dom_nodes.js
######
### Now running mochitest-browser with subsuite devtools.
######

Checking for orphan ssltunnel processes...
Checking for orphan xpcshell processes...
SUITE-START | Running 1 tests
mozprofile.addons WARNING | Could not install /home/vag/projects/gecko-dev/obj-x86_64-pc-linux-gnu/_tests/testing/mochitest/extensions/mozscreenshots: [Errno 2] No such file or directory: '/home/vag/projects/gecko-dev/obj-x86_64-pc-linux-gnu/_tests/testing/mochitest/extensions/mozscreenshots/install.rdf'
dir: devtools/client/webconsole/test
pk12util: PKCS12 IMPORT SUCCESSFUL
MochitestServer : launching [u'/home/vag/projects/gecko-dev/obj-x86_64-pc-linux-gnu/dist/bin/xpcshell', '-g', u'/home/vag/projects/gecko-dev/obj-x86_64-pc-linux-gnu/dist/bin', '-v', '170', '-f', u'/home/vag/projects/gecko-dev/obj-x86_64-pc-linux-gnu/dist/bin/components/httpd.js', '-e', "const _PROFILE_PATH = '/tmp/tmpdDE5TI.mozrunner'; const _SERVER_PORT = '8888'; const _SERVER_ADDR = '127.0.0.1'; const _TEST_PREFIX = undefined; const _DISPLAY_RESULTS = false;", '-f', '/home/vag/projects/gecko-dev/obj-x86_64-pc-linux-gnu/_tests/testing/mochitest/server.js']
runtests.py | Server pid: 5601
runtests.py | Websocket server pid: 5604
runtests.py | SSL tunnel pid: 5608
runtests.py | Running with e10s: True
runtests.py | Running tests: start.

Application command: /home/vag/projects/gecko-dev/obj-x86_64-pc-linux-gnu/dist/bin/firefox -marionette -foreground -profile /tmp/tmpdDE5TI.mozrunner
runtests.py | Application pid: 5630
TEST-INFO | started process Main app process
ATTENTION: default value of option force_s3tc_enable overridden by environment.
ATTENTION: default value of option force_s3tc_enable overridden by environment.
1475141329783	Marionette	INFO	Listening on port 2828
ATTENTION: default value of option force_s3tc_enable overridden by environment.
0 INFO *** Start BrowserChrome Test Results ***
1 INFO checking window state
2 INFO TEST-START | devtools/client/webconsole/test/browser_console_variables_view_dom_nodes.js
3 INFO Console message: [JavaScript Warning: "Use of nsIFile in content process is deprecated." {file: "resource://gre/modules/NetUtil.jsm" line: 304}]
4 INFO Console message: [JavaScript Warning: "Use of nsIFile in content process is deprecated." {file: "resource://gre/modules/NetUtil.jsm" line: 304}]
5 INFO Console message: [JavaScript Warning: "Use of nsIFile in content process is deprecated." {file: "resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/gcli/source/lib/gcli/util/filesystem.js" line: 40}]
6 INFO TEST-PASS | devtools/client/webconsole/test/browser_console_variables_view_dom_nodes.js | Variables view opened - 
7 INFO TEST-PASS | devtools/client/webconsole/test/browser_console_variables_view_dom_nodes.js | rule 0 matched for property 0 - 
8 INFO TEST-PASS | devtools/client/webconsole/test/browser_console_variables_view_dom_nodes.js | rule 1 matched for property 1 - 
9 INFO TEST-PASS | devtools/client/webconsole/test/browser_console_variables_view_dom_nodes.js | rule 2 matched for property 2 - 
10 INFO TEST-PASS | devtools/client/webconsole/test/browser_console_variables_view_dom_nodes.js | rule 3 matched for property 3 - 
11 INFO TEST-PASS | devtools/client/webconsole/test/browser_console_variables_view_dom_nodes.js | rule 4 matched for property 4 - 
12 INFO TEST-PASS | devtools/client/webconsole/test/browser_console_variables_view_dom_nodes.js | rule 5 matched for property 5 - 
13 INFO TEST-PASS | devtools/client/webconsole/test/browser_console_variables_view_dom_nodes.js | rule 6 matched for property 6 - 
14 INFO TEST-PASS | devtools/client/webconsole/test/browser_console_variables_view_dom_nodes.js | rule 7 matched for property 7 - 
15 INFO TEST-PASS | devtools/client/webconsole/test/browser_console_variables_view_dom_nodes.js | rule 8 matched for property 8 - 
16 INFO Removing tab.
17 INFO Waiting for event: 'TabClose' on [object XULElement].
18 INFO Got event: 'TabClose' on [object XULElement].
19 INFO Tab removed and finished closing
MEMORY STAT vsizeMaxContiguous not supported in this build configuration.
MEMORY STAT | vsize 1134MB | residentFast 366MB | heapAllocated 214MB
20 INFO TEST-OK | devtools/client/webconsole/test/browser_console_variables_view_dom_nodes.js | took 2519ms
21 INFO checking window state
Completed ShutdownLeaks collections in process 5691
Completed ShutdownLeaks collections in process 5630
22 INFO TEST-START | Shutdown
23 INFO Browser Chrome Test Summary
24 INFO Passed:  10
25 INFO Failed:  0
26 INFO Todo:    0
27 INFO Mode:    e10s
28 INFO *** End BrowserChrome Test Results ***
TEST-INFO | Main app process: exit 0
runtests.py | Application ran for: 0:00:10.382161
zombiecheck | Reading PID log: /tmp/tmptQvQuApidlog
==> process 5630 launched child process 5654
==> process 5630 launched child process 5691
zombiecheck | Checking for orphan process with PID: 5654
zombiecheck | Checking for orphan process with PID: 5691
Stopping web server
Stopping web socket server
Stopping ssltunnel
WARNING | leakcheck | refcount logging is off, so leaks can't be detected!
runtests.py | Running tests: end.
TEST-INFO | checking window state
Browser Chrome Test Summary
	Passed: 10
	Failed: 0
	Todo: 0
	Mode: e10s
*** End BrowserChrome Test Results ***
SUITE-END | took 11s
Attachment #8796052 - Attachment is obsolete: true
Attachment #8796103 - Flags: review?(lclark)
Comment on attachment 8796103 [details] [diff] [review]
1256796.1.diff

Review of attachment 8796103 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good to me, thanks!
Attachment #8796103 - Flags: review?(lclark) → review+
Keywords: checkin-needed
landed ! thanks for your contribution  Vangelis and welcome to the mozilla community!
Pushed by cbook@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/67993d2f24d2
"[ESLint] Fix ESLint issues in devtools/client/webconsole/test/browser_console_variables_view_dom_nodes.js". r=lclark
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/67993d2f24d2
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 52
Attached patch 1256796.2.diffSplinter Review
Hm, I think I did a mistake and included a change for the .eslintignore file. I am very sorry for that, I just uploaded a corrected diff.
Attachment #8796103 - Attachment is obsolete: true
Flags: needinfo?(lclark)
Attachment #8797070 - Flags: review?(lclark)
Comment on attachment 8797070 [details] [diff] [review]
1256796.2.diff

Review of attachment 8797070 [details] [diff] [review]:
-----------------------------------------------------------------

I opened a separate bug, with the proper bug to fix it (bug 1307705)
Attachment #8797070 - Flags: review?(lclark)
Flags: needinfo?(lclark)
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.