⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 243462 in webkit


Ignore:
Timestamp:
Mar 25, 2019, 2:39:13 PM (7 years ago)
Author:
Wenson Hsieh
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.

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r243450 r243462  
     12019-03-25  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Pull some API testing helper methods out of TestWKWebView
     4        https://bugs.webkit.org/show_bug.cgi?id=196212
     5
     6        Reviewed by Tim Horton.
     7
     8        Refactor some more API testing utility methods, so that they can be used in
     9        tests that do not use TestWKWebView.
     10
     11        * TestWebKitAPI/cocoa/TestWKWebView.h:
     12        * TestWebKitAPI/cocoa/TestWKWebView.mm:
     13        (-[WKWebView loadTestPageNamed:]):
     14        (-[WKWebView synchronouslyLoadHTMLString:baseURL:]):
     15        (-[WKWebView synchronouslyLoadHTMLString:]):
     16        (-[WKWebView synchronouslyLoadTestPageNamed:]):
     17        (-[TestWKWebView loadTestPageNamed:]): Deleted.
     18        (-[TestWKWebView synchronouslyLoadHTMLString:baseURL:]): Deleted.
     19        (-[TestWKWebView synchronouslyLoadHTMLString:]): Deleted.
     20        (-[TestWKWebView synchronouslyLoadTestPageNamed:]): Deleted.
     21
    1222019-03-25  Jer Noble  <jer.noble@apple.com>
    223
  • trunk/Tools/TestWebKitAPI/cocoa/TestWKWebView.h

    r243354 r243462  
    4848@interface WKWebView (TestWebKitAPI)
    4949@property (nonatomic, readonly) NSArray<NSString *> *tagsInBody;
     50- (void)loadTestPageNamed:(NSString *)pageName;
     51- (void)synchronouslyLoadHTMLString:(NSString *)html;
     52- (void)synchronouslyLoadHTMLString:(NSString *)html baseURL:(NSURL *)url;
     53- (void)synchronouslyLoadTestPageNamed:(NSString *)pageName;
    5054- (BOOL)_synchronouslyExecuteEditCommand:(NSString *)command argument:(NSString *)argument;
    5155- (void)expectElementTagsInOrder:(NSArray<NSString *> *)tagNames;
     
    6670- (void)clearMessageHandlers:(NSArray *)messageNames;
    6771- (void)performAfterReceivingMessage:(NSString *)message action:(dispatch_block_t)action;
    68 - (void)loadTestPageNamed:(NSString *)pageName;
    69 - (void)synchronouslyLoadHTMLString:(NSString *)html;
    70 - (void)synchronouslyLoadHTMLString:(NSString *)html baseURL:(NSURL *)url;
    71 - (void)synchronouslyLoadTestPageNamed:(NSString *)pageName;
    7272- (void)waitForMessage:(NSString *)message;
    7373- (void)performAfterLoading:(dispatch_block_t)actions;
  • trunk/Tools/TestWebKitAPI/cocoa/TestWKWebView.mm

    r243354 r243462  
    6565@implementation WKWebView (TestWebKitAPI)
    6666
     67- (void)loadTestPageNamed:(NSString *)pageName
     68{
     69    NSURLRequest *request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:pageName withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]];
     70    [self loadRequest:request];
     71}
     72
     73- (void)synchronouslyLoadHTMLString:(NSString *)html baseURL:(NSURL *)url
     74{
     75    [self loadHTMLString:html baseURL:url];
     76    [self _test_waitForDidFinishNavigation];
     77}
     78
     79- (void)synchronouslyLoadHTMLString:(NSString *)html
     80{
     81    [self synchronouslyLoadHTMLString:html baseURL:[[[NSBundle mainBundle] bundleURL] URLByAppendingPathComponent:@"TestWebKitAPI.resources"]];
     82}
     83
     84- (void)synchronouslyLoadTestPageNamed:(NSString *)pageName
     85{
     86    [self loadTestPageNamed:pageName];
     87    [self _test_waitForDidFinishNavigation];
     88}
     89
    6790- (BOOL)_synchronouslyExecuteEditCommand:(NSString *)command argument:(NSString *)argument
    6891{
     
    344367}
    345368
    346 - (void)loadTestPageNamed:(NSString *)pageName
    347 {
    348     NSURLRequest *request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:pageName withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]];
    349     [self loadRequest:request];
    350 }
    351 
    352 - (void)synchronouslyLoadHTMLString:(NSString *)html baseURL:(NSURL *)url
    353 {
    354     [self loadHTMLString:html baseURL:url];
    355     [self _test_waitForDidFinishNavigation];
    356 }
    357 
    358 - (void)synchronouslyLoadHTMLString:(NSString *)html
    359 {
    360     [self synchronouslyLoadHTMLString:html baseURL:[[[NSBundle mainBundle] bundleURL] URLByAppendingPathComponent:@"TestWebKitAPI.resources"]];
    361 }
    362 
    363 - (void)synchronouslyLoadTestPageNamed:(NSString *)pageName
    364 {
    365     [self loadTestPageNamed:pageName];
    366     [self _test_waitForDidFinishNavigation];
    367 }
    368 
    369369- (void)waitForMessage:(NSString *)message
    370370{
Note: See TracChangeset for help on using the changeset viewer.