Bug 151540

Summary: Create a test app that loads webpages with content filtering enabled
Product: WebKit Reporter: Andy Estes <aestes>
Component: New BugsAssignee: Andy Estes <aestes>
Status: REOPENED ---    
Severity: Normal CC: achristensen, beidson, bfulgham, commit-queue, darin, eric.carlson, kling, mitz, simon.fraser
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Screenshot: disabled
none
Screenshot: enabled
none
Patch none

Description Andy Estes 2015-11-22 02:02:51 PST
Teach MiniBrowser how to enable the mock content filter
Comment 1 Andy Estes 2015-11-22 02:40:25 PST
Created attachment 266049 [details]
Patch
Comment 2 WebKit Commit Bot 2015-11-22 02:43:08 PST
Attachment 266049 [details] did not pass style-queue:


ERROR: Tools/MiniBrowser/mac/SettingsController.m:480:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Tools/MiniBrowser/mac/SettingsController.m:481:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Tools/MiniBrowser/mac/SettingsController.m:498:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Tools/MiniBrowser/mac/SettingsController.m:499:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Tools/MiniBrowser/mac/SettingsController.m:500:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Tools/MiniBrowser/mac/SettingsController.m:501:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Tools/MiniBrowser/mac/SettingsController.m:502:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Tools/MiniBrowser/mac/SettingsController.m:503:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebCore/testing/MockContentFilterSettings.h:31:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebCore/testing/MockContentFilterSettings.h:36:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp:50:  static_cast is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp:51:  static_cast is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp:52:  static_cast is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp:53:  static_cast is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp:54:  static_cast is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp:55:  static_cast is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp:70:  static_cast is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp:71:  static_cast is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 18 in 26 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Andy Estes 2015-11-22 02:48:39 PST
Created attachment 266050 [details]
Screenshot: disabled
Comment 4 Andy Estes 2015-11-22 02:49:02 PST
Created attachment 266051 [details]
Screenshot: enabled
Comment 5 Andy Estes 2015-11-22 03:09:06 PST
Created attachment 266053 [details]
Patch
Comment 6 WebKit Commit Bot 2015-11-22 03:10:57 PST
Attachment 266053 [details] did not pass style-queue:


ERROR: Tools/MiniBrowser/mac/SettingsController.m:480:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Tools/MiniBrowser/mac/SettingsController.m:481:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Tools/MiniBrowser/mac/SettingsController.m:498:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Tools/MiniBrowser/mac/SettingsController.m:499:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Tools/MiniBrowser/mac/SettingsController.m:500:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Tools/MiniBrowser/mac/SettingsController.m:501:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Tools/MiniBrowser/mac/SettingsController.m:502:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Tools/MiniBrowser/mac/SettingsController.m:503:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebCore/testing/MockContentFilterSettings.h:31:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebCore/testing/MockContentFilterSettings.h:36:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp:50:  static_cast is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp:51:  static_cast is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp:52:  static_cast is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp:53:  static_cast is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp:54:  static_cast is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp:55:  static_cast is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp:70:  static_cast is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp:71:  static_cast is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 18 in 26 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Andreas Kling 2015-11-22 08:59:50 PST
Comment on attachment 266053 [details]
Patch

r=me
Comment 8 WebKit Commit Bot 2015-11-22 09:45:57 PST
Comment on attachment 266053 [details]
Patch

Clearing flags on attachment: 266053

Committed r192734: <http://trac.webkit.org/changeset/192734>
Comment 9 WebKit Commit Bot 2015-11-22 09:46:02 PST
All reviewed patches have been landed.  Closing bug.
Comment 10 Andy Estes 2015-11-22 12:50:16 PST
Reverted in http://trac.webkit.org/changeset/192736
Comment 11 Andy Estes 2015-11-25 00:48:43 PST
Committed r192769: <http://trac.webkit.org/changeset/192769>
Comment 12 Simon Fraser (smfr) 2015-11-27 23:03:04 PST
I can't run a release MiniBrowser after this.

Dyld Error Message:
  Library not loaded: @rpath/libWebCoreTestSupport.dylib
  Referenced from: /Volumes/VOLUME/*/MiniBrowser.app/Contents/MacOS/MiniBrowser
  Reason: image not found
Comment 13 Simon Fraser (smfr) 2015-11-27 23:08:47 PST
With DYLD_PRINT_RPATHS=1:

Starting MiniBrowser with DYLD_FRAMEWORK_PATH set to point to built WebKit in /Volumes/DataSSD/Development/apple/webkit/OpenSource/WebKitBuild/Release.
RPATH failed to expanding     @rpath/libWebCoreTestSupport.dylib to: /Volumes/DataSSD/Development/apple/webkit/OpenSource/WebKitBuild/Release/MiniBrowser.app/Contents/MacOS/./libWebCoreTestSupport.dylib
dyld: Library not loaded: @rpath/libWebCoreTestSupport.dylib
  Referenced from: /Volumes/DataSSD/Development/apple/webkit/OpenSource/WebKitBuild/Release/MiniBrowser.app/Contents/MacOS/MiniBrowser
  Reason: image not found


libWebCoreTestSupport.dylib isn't present inside MiniBrowser.app/Contents/MacOS/, only in the WebKitBuild directory.
Comment 14 Simon Fraser (smfr) 2015-11-27 23:09:45 PST
Setting DYLD_LIBRARY_PATH works, but you need to fix all the run-* scripts to set this as well as DYLD_FRAMEWORK_PATH.
Comment 15 Andy Estes 2015-11-28 00:45:33 PST
Oops, sorry. I was running from the WebKit workspace, which handled the DYLD_LIBRARY_PATH part automatically. I'll fix this ASAP.
Comment 16 Simon Fraser (smfr) 2015-11-28 08:50:34 PST
Thinking about this more, I think it's wrong for MiniBrowser to use libWebCoreTestSupport. MiniBrowser should just be a client of the WebKit APIs (and SPIs). It's not meant as a testing harness, where that testing can't be done via those APIs/SPIs.
Comment 17 Andreas Kling 2015-11-28 08:55:08 PST
(In reply to comment #16)
> Thinking about this more, I think it's wrong for MiniBrowser to use
> libWebCoreTestSupport. MiniBrowser should just be a client of the WebKit
> APIs (and SPIs). It's not meant as a testing harness, where that testing
> can't be done via those APIs/SPIs.

FWIW I think it'd be kinda cool if MiniBrowser had an option to enable access to DRT/window.internal APIs..
Comment 18 Simon Fraser (smfr) 2015-11-28 17:01:15 PST
I'd be OK with this if it were possible to copy the MiniBrowser.app bundle somewhere and have it just work. Maybe it should weak link against libWebCoreTestSupport and only expose functionality if present.
Comment 19 Andy Estes 2015-11-30 08:34:02 PST
(In reply to comment #18)
> I'd be OK with this if it were possible to copy the MiniBrowser.app bundle
> somewhere and have it just work. Maybe it should weak link against
> libWebCoreTestSupport and only expose functionality if present.

I didn't consider the use case of running MiniBrowser.app against system WebKit frameworks, but I suppose this would have mostly worked before this change.

Weak linking might be tricky since I don't know where $BUILT_PRODUCTS_DIR is at runtime. Maybe I can do some @rpath trickery, or copy libWebCoreTestSupport.dylib into the bundle at build time.

I don't currently have time to work on this, so for now I'll roll out r192769 and circle back later.
Comment 20 Andy Estes 2015-11-30 10:22:14 PST
Reverted again in r192801.
Comment 21 Andy Estes 2015-12-01 11:54:32 PST
Simon suggested on IRC that it would be cleaner to write a separate test app for content filtering. I like this idea, so I'm going to re-title this bug to be about doing that.