DevTools/Hacking: Difference between revisions

Fold in migration changes
(Fold in migration changes)
(Fold in migration changes)
Line 35: Line 35:
== Incremental Builds ==
== Incremental Builds ==


Once you've already built Firefox once, and you just want to incrementally update your build with your latest devtools changes, you can run:
Once you've already built Firefox once, and you just want to incrementally update your build with your latest DevTools changes, you can run:


   $ ./mach build devtools/*
   $ ./mach build devtools/*
Line 87: Line 87:
= Developer Tools Directories Overview =
= Developer Tools Directories Overview =


* '''<tt>toolkit/devtools</tt>''': Code for the devtools client and server, and all code shared between the front end and client/server. If we are using any third party libraries, or importing external repositories into our tree, those libraries generally live here (eg, <tt>toolkit/devtools/acorn</tt>).
* '''<tt>devtools/shared</tt>''': Code shared by both the DevTools client (front-end UI) and server. If we are using any third party libraries, or importing external repositories into our tree, those libraries generally live here (eg, <tt>devtools/shared/acorn</tt>), assuming they are used by both client and server.
** '''<tt>toolkit/devtools/server</tt>''': Code for the devtools [[Remote Debugging Protocol]] server and transport layer.
** '''<tt>devtools/server</tt>''': Code for the DevTools [[Remote Debugging Protocol]] server and transport layer.
*** '''<tt>toolkit/devtools/server/actors</tt>''': [[Remote_Debugging_Protocol#Actors RDP Actors]]. Note that if you're modifying the RDP, you may need to worry about [[DevTools/Backwards_Compatibility|backwards compatibilty with older protocol implementations]].
*** '''<tt>devtools/server/actors</tt>''': [[Remote_Debugging_Protocol#Actors RDP Actors]]. Note that if you're modifying the RDP, you may need to worry about [[DevTools/Backwards_Compatibility|backwards compatibilty with older protocol implementations]].
** '''<tt>toolkit/devtools/client</tt>''': Code for the devtools [[Remote Debugging Protocol]] client.
** '''<tt>devtools/shared/client</tt>''': Code for the DevTools [[Remote Debugging Protocol]] client. (You may wonder why this is not in <tt>devtools/client</tt> below: it's mainly because tests in server also need access to the RDP client.)
* '''<tt>browser/devtools</tt>''': Front end user interfaces for our tools. Should be pretty obvious what is what based on the directory names and each panel we have in our toolbox.
* '''<tt>devtools/client</tt>''': Front end user interfaces for our tools. Should be pretty obvious what is what based on the directory names and each panel we have in our toolbox. This directory is only shipped with desktop Firefox, as opposed to other directories above, which are shipped with all Gecko products (Firefox OS, Firefox for Android, etc.)


= Running the Developer Tools Tests =
= Running the Developer Tools Tests =
Line 105: Line 105:
To run all DevTools tests, regardless of suite type:
To run all DevTools tests, regardless of suite type:


   $ ./mach test toolkit/devtools
   $ ./mach test devtools/*
  $ ./mach test browser/devtools


The following sections show more specific commands for running only a single suite or single test in a suite.
The following sections show more specific commands for running only a single suite or single test in a suite.
Line 118: Line 117:
To run a specific xpcshell test:
To run a specific xpcshell test:


   $ ./mach xpcshell-test toolkit/devtools/path/to/the/test_you_want_to_run.js
   $ ./mach xpcshell-test devtools/path/to/the/test_you_want_to_run.js


== Chrome Mochitests ==
== Chrome Mochitests ==


To run the whole suite of chrome mochitests for devtools:
To run the whole suite of chrome mochitests for DevTools:


   $ ./mach mochitest -f chrome --tag devtools
   $ ./mach mochitest -f chrome --tag devtools
Line 128: Line 127:
To run a specific chrome mochitest:
To run a specific chrome mochitest:


   $ ./mach mochitest toolkit/devtools/path/to/the/test_you_want_to_run.html
   $ ./mach mochitest devtools/path/to/the/test_you_want_to_run.html


== DevTools Mochitests ==
== DevTools Mochitests ==


To run the whole suite of browser mochitests for devtools (sit back and relax):
To run the whole suite of browser mochitests for DevTools (sit back and relax):


   $ ./mach mochitest --subsuite devtools --tag devtools
   $ ./mach mochitest --subsuite devtools --tag devtools
Line 138: Line 137:
To run a specific tool's suite of browser mochitests:
To run a specific tool's suite of browser mochitests:


   $ ./mach mochitest browser/devtools/<tool>
   $ ./mach mochitest devtools/client/<tool>


For example, run all of the debugger browser mochitests:
For example, run all of the debugger browser mochitests:


   $ ./mach mochitest browser/devtools/debugger
   $ ./mach mochitest devtools/client/debugger


To run a specific devtools mochitest:
To run a specific DevTools mochitest:


   $ ./mach mochitest browser/devtools/path/to/the/test_you_want_to_run.js
   $ ./mach mochitest devtools/client/path/to/the/test_you_want_to_run.js


To help with writing nice, maintainable and consistent devtools mochitests, please follow our [https://wiki.mozilla.org/DevTools/mochitests_coding_standards devtools mochitests coding guide].
To help with writing nice, maintainable and consistent DevTools mochitests, please follow our [https://wiki.mozilla.org/DevTools/mochitests_coding_standards DevTools mochitests coding guide].


Note that the mochitests '''must''' have focus while running.
Note that the mochitests '''must''' have focus while running.
Confirmed users
177

edits