Confirmed users
14,525
edits
Line 38: | Line 38: | ||
== Refactoring == | == Refactoring == | ||
=== Phase I === | === Phase I === | ||
Goal | {| class="fullwidth-table" | ||
| Goal | |||
| Implement lowest hanging fruit, make all tests reflect the styleguide | |||
|- | |||
| {{bug|}} | |||
| Replace all constants with CONSTANTS | |||
* gDelay, 100 => DELAY | |||
* gTimeout, 5000 => TIMEOUT | |||
* sleep() parameter => SLEEP_TIMEOUT | |||
* unique timeouts => CONSTANT (ie. SEARCH_TIMEOUT) | |||
|- | |||
| {{bug|}} | |||
| Replace discrete, unchanging values with CONSTANTS | |||
|- | |||
| {{bug|}} | |||
| Migrate tests away from testGeneral | |||
|- | |||
| {{bug|}} | |||
| All test pages in LOCAL_TEST_PAGES array | |||
|- | |||
| {{bug|}} | |||
| Replace waitForEval() with waitFor() where possible | |||
|- | |||
| {{bug|}} | |||
| Replace DELAY/TIMEOUT with waitFor() where possible | |||
|- | |||
| {{bug|}} | |||
| License block formatting | |||
* "the Mozilla Foundation" | |||
* contributor list alignment | |||
|- | |||
| {{bug|}} | |||
| All error messages use format: | |||
* | |||
|- | |||
| {{bug|}} | |||
| Whitespace formatting | |||
* No trailing whitespace | |||
* 1 newline at end of file | |||
* 2-space indentation where appropriate | |||
* Wrap on 80-characters where appropriate | |||
|- | |||
| {{bug|}} | |||
| Replace sleep() with waitFor() where possible | |||
|- | |||
| {{bug|}} | |||
| Extract any ''new elementslib...'' from function parameter list | |||
|- | |||
| {{bug|}} | |||
| Replace all array iteration with Array.forEach() | |||
|- | |||
| {{bug|}} | |||
| Replace anonymous functions with named functions | |||
|- | |||
| {{bug|}} | |||
| Adopt consistent commenting style | |||
|- | |||
| {{bug|}} | |||
| All iterators as ''i'', not ''ii'' | |||
|- | |||
| {{bug|}} | |||
| Adopt consistent conditional cuddling | |||
|} | |||
''Note: The above comes from the agreed to refactoring [http://etherpad.mozilla.com:9000/mozmill-test-refactor guidelines]'' | |||
=== Phase II === | === Phase II === |