commit | b04f7e871793ebec5d439227dd11dab17093b450 | [log] [tgz] |
---|---|---|
author | Goktug Gokdogan <goktug@google.com> | Tue Oct 31 16:44:04 2017 -0700 |
committer | Goktug Gokdogan <goktug@google.com> | Wed Nov 01 19:51:56 2017 +0000 |
tree | 33a9a028bc8113e2ae37c8fa91234383def28228 | |
parent | 62e0d9a92f699c01662a3db81550113b6442cc61 [diff] |
Fixes StackTraceNativeTest failing on lastest Chrome Latest Chrome added "new" prefix to constructor function frame and this patch updates the test to handle and ignore the new prefix from test frames while asserting. Change-Id: I8db8a26f4a0fe6bd9fe5d7aaef9e92593c0d2647 Review-Link: https://gwt-review.googlesource.com/#/c/19980/
diff --git a/user/test/com/google/gwt/core/client/impl/StackTraceTestBase.java b/user/test/com/google/gwt/core/client/impl/StackTraceTestBase.java index c33d57a..ec447c1 100644 --- a/user/test/com/google/gwt/core/client/impl/StackTraceTestBase.java +++ b/user/test/com/google/gwt/core/client/impl/StackTraceTestBase.java
@@ -77,6 +77,13 @@ } StackTraceElement actualElement = trace[i]; String methodName = actualElement == null ? "!MISSING!" : actualElement.getMethodName(); + + // Some new browsers (e.g. Chrome) adds "new" to frame if it was constructor call + String ctorFramePrefix = "new "; + if (methodName.startsWith(ctorFramePrefix)) { + methodName = methodName.substring(ctorFramePrefix.length()); + } + if (expectedMethodName.equals(methodName)) { i++; continue;