Bug 150525 - Expose more information about the exception in WKErrorJavaScriptExceptionOccurred errors
Summary: Expose more information about the exception in WKErrorJavaScriptExceptionOccu...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Horton
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-10-23 17:54 PDT by Tim Horton
Modified: 2015-10-25 11:07 PDT (History)
8 users (show)

See Also:


Attachments
Patch (43.28 KB, patch)
2015-10-23 17:56 PDT, Tim Horton
no flags Details | Formatted Diff | Diff
Patch (43.22 KB, patch)
2015-10-23 18:10 PDT, Tim Horton
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Horton 2015-10-23 17:54:43 PDT
Expose more information about the exception in WKErrorJavaScriptExceptionOccurred errors
Comment 1 Tim Horton 2015-10-23 17:56:03 PDT
Created attachment 263970 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2015-10-23 17:56:46 PDT
<rdar://problem/23245452>
Comment 3 WebKit Commit Bot 2015-10-23 17:58:10 PDT
Attachment 263970 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/WebPageProxy.cpp:2591:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKWebViewEvaluateJavaScript.mm:97:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKWebViewEvaluateJavaScript.mm:116:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit2/UIProcess/WebPageProxy.h:766:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 4 in 21 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Tim Horton 2015-10-23 18:10:59 PDT
Created attachment 263971 [details]
Patch
Comment 5 WebKit Commit Bot 2015-10-23 18:13:44 PDT
Attachment 263971 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/WebPageProxy.cpp:2591:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKWebViewEvaluateJavaScript.mm:112:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit2/UIProcess/WebPageProxy.h:766:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 3 in 21 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 mitz 2015-10-24 15:26:05 PDT
Comment on attachment 263971 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=263971&action=review

> Source/WebKit2/UIProcess/API/Cocoa/WKErrorPrivate.h:50
> + the exception source URL (as an NSString) for WKErrorJavaScriptExceptionOccurred errors. */

Why not as an NSURL?

> Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:654
> +		A14FC5831B89739100D107EB /* WKWebViewConfigurationExtras.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WKWebViewConfigurationExtras.mm; path = ../../WKWebViewConfigurationExtras.mm; sourceTree = "<group>"; };
> +		A14FC5841B89739100D107EB /* WKWebViewConfigurationExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKWebViewConfigurationExtras.h; path = ../../WKWebViewConfigurationExtras.h; sourceTree = "<group>"; };
>  		A14FC5861B8991B600D107EB /* ContentFiltering.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ContentFiltering.mm; sourceTree = "<group>"; };
>  		A14FC5891B89927100D107EB /* ContentFilteringPlugIn.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ContentFilteringPlugIn.mm; sourceTree = "<group>"; };
> -		A14FC58D1B8AE36500D107EB /* TestProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TestProtocol.h; path = cocoa/TestProtocol.h; sourceTree = "<group>"; };
> -		A14FC58E1B8AE36500D107EB /* TestProtocol.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TestProtocol.mm; path = cocoa/TestProtocol.mm; sourceTree = "<group>"; };
> +		A14FC58D1B8AE36500D107EB /* TestProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TestProtocol.h; path = ../../cocoa/TestProtocol.h; sourceTree = "<group>"; };
> +		A14FC58E1B8AE36500D107EB /* TestProtocol.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TestProtocol.mm; path = ../../cocoa/TestProtocol.mm; sourceTree = "<group>"; };

??

> Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:981
> -			path = cocoa/WebProcessPlugIn;
> +			path = ../../cocoa/WebProcessPlugIn;

??
Comment 7 Darin Adler 2015-10-24 16:00:04 PDT
Comment on attachment 263971 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=263971&action=review

>> Source/WebKit2/UIProcess/API/Cocoa/WKErrorPrivate.h:50
>> + the exception source URL (as an NSString) for WKErrorJavaScriptExceptionOccurred errors. */
> 
> Why not as an NSURL?

Excellent question.

> Source/WebKit2/UIProcess/WebPageProxy.cpp:2594
> +        callbackFunction(nullptr, false, ExceptionDetails(), CallbackBase::Error::Unknown);

Sometimes I like to use { } instead of ExceptionDetails() at a call site like this one. Or possibly ExceptionDetails{ }.

> Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:649
> +		A14FC5831B89739100D107EB /* WKWebViewConfigurationExtras.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WKWebViewConfigurationExtras.mm; path = ../../WKWebViewConfigurationExtras.mm; sourceTree = "<group>"; };

As Dan noted below, I see a lot of changes like this and it does not seem good.
Comment 8 Tim Horton 2015-10-24 18:12:50 PDT
(In reply to comment #7)
> Comment on attachment 263971 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=263971&action=review
> 
> >> Source/WebKit2/UIProcess/API/Cocoa/WKErrorPrivate.h:50
> >> + the exception source URL (as an NSString) for WKErrorJavaScriptExceptionOccurred errors. */
> > 
> > Why not as an NSURL?
> 
> Excellent question.

Will fix!

> > Source/WebKit2/UIProcess/WebPageProxy.cpp:2594
> > +        callbackFunction(nullptr, false, ExceptionDetails(), CallbackBase::Error::Unknown);
> 
> Sometimes I like to use { } instead of ExceptionDetails() at a call site
> like this one. Or possibly ExceptionDetails{ }.

I hadn't picked up that trick yet, but I like it!

> > Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:649
> > +		A14FC5831B89739100D107EB /* WKWebViewConfigurationExtras.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WKWebViewConfigurationExtras.mm; path = ../../WKWebViewConfigurationExtras.mm; sourceTree = "<group>"; };
> 
> As Dan noted below, I see a lot of changes like this and it does not seem
> good.

This was actually semi-intentional, but I'll do it in another patch. The XCode project has duplicate groups (cocoa and Cocoa) in one place.
Comment 9 Tim Horton 2015-10-24 22:38:34 PDT
http://trac.webkit.org/changeset/191543
Comment 10 Tim Horton 2015-10-24 23:15:15 PDT
Something bad is happening: https://build.webkit.org/builders/Apple%20El%20Capitan%20Release%20WK2%20%28Tests%29/builds/680/steps/run-api-tests/logs/stdio

Building release to see if I can reproduce.
Comment 11 Tim Horton 2015-10-24 23:37:12 PDT
(In reply to comment #10)
> Something bad is happening:
> https://build.webkit.org/builders/
> Apple%20El%20Capitan%20Release%20WK2%20%28Tests%29/builds/680/steps/run-api-
> tests/logs/stdio
> 
> Building release to see if I can reproduce.

Weird? In a subsequent build it's complaining about something *else* I added to the API in another patch (http://trac.webkit.org/changeset/191545).
Comment 12 Tim Horton 2015-10-24 23:37:46 PDT
(In reply to comment #11)
> (In reply to comment #10)
> > Something bad is happening:
> > https://build.webkit.org/builders/
> > Apple%20El%20Capitan%20Release%20WK2%20%28Tests%29/builds/680/steps/run-api-
> > tests/logs/stdio
> > 
> > Building release to see if I can reproduce.
> 
> Weird? In a subsequent build it's complaining about something *else* I added
> to the API in another patch (http://trac.webkit.org/changeset/191545).

And neither of these reproduce locally.
Comment 13 Tim Horton 2015-10-24 23:40:47 PDT
(In reply to comment #10)
> Something bad is happening:
> https://build.webkit.org/builders/
> Apple%20El%20Capitan%20Release%20WK2%20%28Tests%29/builds/680/steps/run-api-
> tests/logs/stdio
> 
> Building release to see if I can reproduce.

Also not happening on Yosemite bots :( I don't get it.
Comment 14 mitz 2015-10-24 23:42:27 PDT
(In reply to comment #10)
> Something bad is happening:
> https://build.webkit.org/builders/
> Apple%20El%20Capitan%20Release%20WK2%20%28Tests%29/builds/680/steps/run-api-
> tests/logs/stdio
> 
> Building release to see if I can reproduce.

Is there any way to see the full build log?
Comment 15 mitz 2015-10-24 23:48:30 PDT
Looks like System Integrity Protection is making TestWebKitAPI use WebKit from /System/Library/Frameworks instead of from the archive.
Comment 16 Tim Horton 2015-10-25 00:10:01 PDT
(In reply to comment #15)
> Looks like System Integrity Protection is making TestWebKitAPI use WebKit
> from /System/Library/Frameworks instead of from the archive.

Wow! I'm surprised that hasn't come up before!
Comment 17 mitz 2015-10-25 09:33:32 PDT
(In reply to comment #16)
> (In reply to comment #15)
> > Looks like System Integrity Protection is making TestWebKitAPI use WebKit
> > from /System/Library/Frameworks instead of from the archive.
> 
> Wow! I'm surprised that hasn't come up before!

It has come up before and <http://trac.webkit.org/r190412> was supposed to take care of it.
Comment 18 Alexey Proskuryakov 2015-10-25 10:57:02 PDT
There must be another location that I missed - it's failing when generating a list of tests to run, not when running the tests.