gwt /
gwt /
59fb8d66b30698156116c7f8761c1560805e4aa3 Overhauls the generated code that is required by GWTTestCase to function.
Benefits are:
- Better stack traces
- Reduces generated code
- Simplifies the flow
Previously, each module following classes was generated:
1. GwtRunnerImplXYZ (e.g. GWTRunnerImplSafari) extends GWTRunner adds a method
that can instantiate a test by its name. Also adds getUserAgentProperty method
which requires a new class to be generated for each permutation.
2. __SomeTestClassName_unitTestImpl (__EditorTest_unitTestImpl) that extends user
test class and add a method that can call a test method by its name.
The switching in these generated methods were based on a long chain if else java
statements that are making string comparison.
There is some potential performance impact but more importantly this was causing
stack traces that was confusing as test methods can be potentially inlined and disappear
from stack trace where the generated class name was showing up instead of the real test
class name.
This alternative solution uses a different approach for generating the necessary code
so that methods will not be inlined and real test class will not be replaced.
Following is new set of class generated:
1. GwtRunnerProxyImpl implements GWTRunnerProxy and adds createTestAccessor method
that returns a js object that provides a function map for calling constructor and
test methods indexed by name.
2. GwtRunnerProxyImplXyz (e.g. GwtRunnerProxyImplSafari) that extends generated
GwtRunnerProxyImpl and implements getUserAgentPropery for each permutation.
As a side benefit it looks this approach also provides slight performance improvements
compared to previous one.
Change-Id: Id3f9dbb2dbec9bc89cd415e4d3189e63c8e77b73
Review-Link: https://gwt-review.googlesource.com/#/c/1960/
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@11531 8db76d5a-ed1c-0410-87a9-c151d255dfc7
6 files changed