Title: [243462] trunk/Tools
- Revision
- 243462
- Author
- wenson_hs...@apple.com
- Date
- 2019-03-25 14:39:13 -0700 (Mon, 25 Mar 2019)
Log Message
Pull some API testing helper methods out of TestWKWebView
https://bugs.webkit.org/show_bug.cgi?id=196212
Reviewed by Tim Horton.
Refactor some more API testing utility methods, so that they can be used in
tests that do not use TestWKWebView.
* TestWebKitAPI/cocoa/TestWKWebView.h:
* TestWebKitAPI/cocoa/TestWKWebView.mm:
(-[WKWebView loadTestPageNamed:]):
(-[WKWebView synchronouslyLoadHTMLString:baseURL:]):
(-[WKWebView synchronouslyLoadHTMLString:]):
(-[WKWebView synchronouslyLoadTestPageNamed:]):
(-[TestWKWebView loadTestPageNamed:]): Deleted.
(-[TestWKWebView synchronouslyLoadHTMLString:baseURL:]): Deleted.
(-[TestWKWebView synchronouslyLoadHTMLString:]): Deleted.
(-[TestWKWebView synchronouslyLoadTestPageNamed:]): Deleted.
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (243461 => 243462)
--- trunk/Tools/ChangeLog 2019-03-25 21:28:09 UTC (rev 243461)
+++ trunk/Tools/ChangeLog 2019-03-25 21:39:13 UTC (rev 243462)
@@ -1,3 +1,24 @@
+2019-03-25 Wenson Hsieh <wenson_hs...@apple.com>
+
+ Pull some API testing helper methods out of TestWKWebView
+ https://bugs.webkit.org/show_bug.cgi?id=196212
+
+ Reviewed by Tim Horton.
+
+ Refactor some more API testing utility methods, so that they can be used in
+ tests that do not use TestWKWebView.
+
+ * TestWebKitAPI/cocoa/TestWKWebView.h:
+ * TestWebKitAPI/cocoa/TestWKWebView.mm:
+ (-[WKWebView loadTestPageNamed:]):
+ (-[WKWebView synchronouslyLoadHTMLString:baseURL:]):
+ (-[WKWebView synchronouslyLoadHTMLString:]):
+ (-[WKWebView synchronouslyLoadTestPageNamed:]):
+ (-[TestWKWebView loadTestPageNamed:]): Deleted.
+ (-[TestWKWebView synchronouslyLoadHTMLString:baseURL:]): Deleted.
+ (-[TestWKWebView synchronouslyLoadHTMLString:]): Deleted.
+ (-[TestWKWebView synchronouslyLoadTestPageNamed:]): Deleted.
+
2019-03-25 Jer Noble <jer.no...@apple.com>
Test for: 196095 Inband Text Track cues interspersed with Data cues can display out of order.
Modified: trunk/Tools/TestWebKitAPI/cocoa/TestWKWebView.h (243461 => 243462)
--- trunk/Tools/TestWebKitAPI/cocoa/TestWKWebView.h 2019-03-25 21:28:09 UTC (rev 243461)
+++ trunk/Tools/TestWebKitAPI/cocoa/TestWKWebView.h 2019-03-25 21:39:13 UTC (rev 243462)
@@ -47,6 +47,10 @@
@interface WKWebView (TestWebKitAPI)
@property (nonatomic, readonly) NSArray<NSString *> *tagsInBody;
+- (void)loadTestPageNamed:(NSString *)pageName;
+- (void)synchronouslyLoadHTMLString:(NSString *)html;
+- (void)synchronouslyLoadHTMLString:(NSString *)html baseURL:(NSURL *)url;
+- (void)synchronouslyLoadTestPageNamed:(NSString *)pageName;
- (BOOL)_synchronouslyExecuteEditCommand:(NSString *)command argument:(NSString *)argument;
- (void)expectElementTagsInOrder:(NSArray<NSString *> *)tagNames;
- (void)expectElementCount:(NSInteger)count querySelector:(NSString *)querySelector;
@@ -65,10 +69,6 @@
- (instancetype)initWithFrame:(CGRect)frame configuration:(WKWebViewConfiguration *)configuration addToWindow:(BOOL)addToWindow;
- (void)clearMessageHandlers:(NSArray *)messageNames;
- (void)performAfterReceivingMessage:(NSString *)message action:(dispatch_block_t)action;
-- (void)loadTestPageNamed:(NSString *)pageName;
-- (void)synchronouslyLoadHTMLString:(NSString *)html;
-- (void)synchronouslyLoadHTMLString:(NSString *)html baseURL:(NSURL *)url;
-- (void)synchronouslyLoadTestPageNamed:(NSString *)pageName;
- (void)waitForMessage:(NSString *)message;
- (void)performAfterLoading:(dispatch_block_t)actions;
- (void)waitForNextPresentationUpdate;
Modified: trunk/Tools/TestWebKitAPI/cocoa/TestWKWebView.mm (243461 => 243462)
--- trunk/Tools/TestWebKitAPI/cocoa/TestWKWebView.mm 2019-03-25 21:28:09 UTC (rev 243461)
+++ trunk/Tools/TestWebKitAPI/cocoa/TestWKWebView.mm 2019-03-25 21:39:13 UTC (rev 243462)
@@ -64,6 +64,29 @@
@implementation WKWebView (TestWebKitAPI)
+- (void)loadTestPageNamed:(NSString *)pageName
+{
+ NSURLRequest *request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:pageName withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]];
+ [self loadRequest:request];
+}
+
+- (void)synchronouslyLoadHTMLString:(NSString *)html baseURL:(NSURL *)url
+{
+ [self loadHTMLString:html baseURL:url];
+ [self _test_waitForDidFinishNavigation];
+}
+
+- (void)synchronouslyLoadHTMLString:(NSString *)html
+{
+ [self synchronouslyLoadHTMLString:html baseURL:[[[NSBundle mainBundle] bundleURL] URLByAppendingPathComponent:@"TestWebKitAPI.resources"]];
+}
+
+- (void)synchronouslyLoadTestPageNamed:(NSString *)pageName
+{
+ [self loadTestPageNamed:pageName];
+ [self _test_waitForDidFinishNavigation];
+}
+
- (BOOL)_synchronouslyExecuteEditCommand:(NSString *)command argument:(NSString *)argument
{
__block bool done = false;
@@ -343,29 +366,6 @@
[_testHandler addMessage:message withHandler:action];
}
-- (void)loadTestPageNamed:(NSString *)pageName
-{
- NSURLRequest *request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:pageName withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]];
- [self loadRequest:request];
-}
-
-- (void)synchronouslyLoadHTMLString:(NSString *)html baseURL:(NSURL *)url
-{
- [self loadHTMLString:html baseURL:url];
- [self _test_waitForDidFinishNavigation];
-}
-
-- (void)synchronouslyLoadHTMLString:(NSString *)html
-{
- [self synchronouslyLoadHTMLString:html baseURL:[[[NSBundle mainBundle] bundleURL] URLByAppendingPathComponent:@"TestWebKitAPI.resources"]];
-}
-
-- (void)synchronouslyLoadTestPageNamed:(NSString *)pageName
-{
- [self loadTestPageNamed:pageName];
- [self _test_waitForDidFinishNavigation];
-}
-
- (void)waitForMessage:(NSString *)message
{
__block bool isDoneWaiting = false;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes