summaryrefslogtreecommitdiff
path: root/chromium/styleguide/java/java.md
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-06 12:48:11 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:33:43 +0000
commit7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (patch)
treefa14ba0ca8d2683ba2efdabd246dc9b18a1229c6 /chromium/styleguide/java/java.md
parent79b4f909db1049fca459c07cca55af56a9b54fe3 (diff)
downloadqtwebengine-chromium-7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3.tar.gz
BASELINE: Update Chromium to 84.0.4147.141
Change-Id: Ib85eb4cfa1cbe2b2b81e5022c8cad5c493969535 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/styleguide/java/java.md')
-rw-r--r--chromium/styleguide/java/java.md10
1 files changed, 7 insertions, 3 deletions
diff --git a/chromium/styleguide/java/java.md b/chromium/styleguide/java/java.md
index 4f302e99b9c..36ebfcae49f 100644
--- a/chromium/styleguide/java/java.md
+++ b/chromium/styleguide/java/java.md
@@ -30,9 +30,6 @@ is encouraged, but there are some gotchas:
### Lambdas and Method References
* These are syntactic sugar for creating anonymous inner classes.
- * Furthermore, stateless lambdas
- [become singletons](https://stackoverflow.com/questions/27524445/does-a-lambda-expression-create-an-object-on-the-heap-every-time-its-executed)
- and so do not result in new instances when used in loops.
* Use them only where the cost of an extra class & method definition is
justified.
@@ -216,6 +213,13 @@ This is the order of the import groups:
1. java
1. javax
+## Test-only Code
+Functions used only for testing should be restricted to test-only usages
+with the testing suffixes supported [PRESUMBIT.py](https://chromium.googlesource.com/chromium/src/+/master/PRESUBMIT.py).
+`ForTesting` is the conventional suffix although similar patterns, such as
+`ForTest`, are also accepted. These suffixes are checked at presubmit time
+to ensure the functions are called only by test files.
+
## Location
"Top level directories" are defined as directories with a GN file, such as
[//base](https://chromium.googlesource.com/chromium/src/+/master/base/)