REOPENED Bug 151540
Create a test app that loads webpages with content filtering enabled
https://bugs.webkit.org/show_bug.cgi?id=151540
Summary Create a test app that loads webpages with content filtering enabled
Andy Estes
Reported 2015-11-22 02:02:51 PST
Teach MiniBrowser how to enable the mock content filter
Attachments
Patch (66.14 KB, patch)
2015-11-22 02:40 PST, Andy Estes
no flags
Screenshot: disabled (2.63 MB, image/png)
2015-11-22 02:48 PST, Andy Estes
no flags
Screenshot: enabled (2.04 MB, image/png)
2015-11-22 02:49 PST, Andy Estes
no flags
Patch (66.18 KB, patch)
2015-11-22 03:09 PST, Andy Estes
no flags
Andy Estes
Comment 1 2015-11-22 02:40:25 PST
WebKit Commit Bot
Comment 2 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.
Andy Estes
Comment 3 2015-11-22 02:48:39 PST
Created attachment 266050 [details] Screenshot: disabled
Andy Estes
Comment 4 2015-11-22 02:49:02 PST
Created attachment 266051 [details] Screenshot: enabled
Andy Estes
Comment 5 2015-11-22 03:09:06 PST
WebKit Commit Bot
Comment 6 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.
Andreas Kling
Comment 7 2015-11-22 08:59:50 PST
Comment on attachment 266053 [details] Patch r=me
WebKit Commit Bot
Comment 8 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>
WebKit Commit Bot
Comment 9 2015-11-22 09:46:02 PST
All reviewed patches have been landed. Closing bug.
Andy Estes
Comment 10 2015-11-22 12:50:16 PST
Andy Estes
Comment 11 2015-11-25 00:48:43 PST
Simon Fraser (smfr)
Comment 12 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
Simon Fraser (smfr)
Comment 13 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.
Simon Fraser (smfr)
Comment 14 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.
Andy Estes
Comment 15 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.
Simon Fraser (smfr)
Comment 16 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.
Andreas Kling
Comment 17 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..
Simon Fraser (smfr)
Comment 18 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.
Andy Estes
Comment 19 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.
Andy Estes
Comment 20 2015-11-30 10:22:14 PST
Reverted again in r192801.
Andy Estes
Comment 21 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.
Note You need to log in before you can comment on or make changes to this bug.