Changeset 267640 in webkit


Ignore:
Timestamp:
Sep 26, 2020 4:23:24 PM (4 years ago)
Author:
Darin Adler
Message:

Change dumpAsText to strip trailing spaces
https://bugs.webkit.org/show_bug.cgi?id=216944

Reviewed by Alan Bujtas.

  • DumpRenderTree/mac/DumpRenderTree.mm:

(dumpFramesAsText): Strip trailing spaces.

  • DumpRenderTree/mac/FrameLoadDelegate.mm:

(-[FrameLoadDelegate webView:willPerformClientRedirectToURL:delay:fireDate:forFrame:]):
Don't add trailing space.

  • DumpRenderTree/mac/UIDelegate.mm:

(-[UIDelegate webView:addMessageToConsole:withSource:]): Ditto.
(addLeadingSpaceStripTrailingSpaces): Added.
(stripTrailingSpaces): Added.
(-[UIDelegate webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:]): Don't add trailing space.
(-[UIDelegate webView:runJavaScriptConfirmPanelWithMessage:initiatedByFrame:]): Ditto.
(-[UIDelegate webView:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame:]): Ditto.
(-[UIDelegate webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:]): Ditto.
(-[UIDelegate webView:setStatusText:]): Ditto.

  • DumpRenderTree/win/DumpRenderTree.cpp:

(dumpFramesAsText): Strip trailing spaces.

  • DumpRenderTree/win/FrameLoadDelegate.cpp:

(FrameLoadDelegate::willPerformClientRedirectToURL): Don't add trailing space.

  • DumpRenderTree/win/UIDelegate.cpp:

(toMessage): Changed to return std::wstring.
(stripTrailingSpaces): Added.
(addLeadingSpaceStripTrailingSpaces): Added.
(UIDelegate::runJavaScriptAlertPanelWithMessage): Don't add trailing space.
(UIDelegate::runJavaScriptConfirmPanelWithMessage): Ditto.
(UIDelegate::runJavaScriptTextInputPanelWithPrompt): Ditto.
(UIDelegate::runBeforeUnloadConfirmPanelWithMessage): Ditto.
(UIDelegate::webViewAddMessageToConsole): Ditto.
(UIDelegate::setStatusText): Ditto.

  • Scripts/webkitpy/port/base.py:

(Port.do_text_results_differ): Strip trailing spaces from expected text.
Plan is to remove this after stripping the actual expected.txt files.

  • Scripts/webkitpy/port/win.py:

(WinPort.do_text_results_differ): Call through to base.

  • WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:

(WTR::dumpFrameText): Strip trailing spaces.
(WTR::InjectedBundlePage::willPerformClientRedirectForFrame): Don't add trailing space.
(WTR::InjectedBundlePage::decidePolicyForNavigationAction): Ditto.
(WTR::stripTrailingSpaces): Added.
(WTR::addLeadingSpaceStripTrailingSpaces): Added.
(WTR::InjectedBundlePage::willAddMessageToConsole): Don't add trailing space.
(WTR::InjectedBundlePage::willRunJavaScriptAlert): Ditto.
(WTR::InjectedBundlePage::willRunJavaScriptConfirm): Ditto.
(WTR::InjectedBundlePage::willRunJavaScriptPrompt): Ditto.

Location:
trunk/Tools
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r267618 r267640  
     12020-09-25  Darin Adler  <darin@apple.com>
     2
     3        Change dumpAsText to strip trailing spaces
     4        https://bugs.webkit.org/show_bug.cgi?id=216944
     5
     6        Reviewed by Alan Bujtas.
     7
     8        * DumpRenderTree/mac/DumpRenderTree.mm:
     9        (dumpFramesAsText): Strip trailing spaces.
     10        * DumpRenderTree/mac/FrameLoadDelegate.mm:
     11        (-[FrameLoadDelegate webView:willPerformClientRedirectToURL:delay:fireDate:forFrame:]):
     12        Don't add trailing space.
     13        * DumpRenderTree/mac/UIDelegate.mm:
     14        (-[UIDelegate webView:addMessageToConsole:withSource:]): Ditto.
     15        (addLeadingSpaceStripTrailingSpaces): Added.
     16        (stripTrailingSpaces): Added.
     17        (-[UIDelegate webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:]): Don't add trailing space.
     18        (-[UIDelegate webView:runJavaScriptConfirmPanelWithMessage:initiatedByFrame:]): Ditto.
     19        (-[UIDelegate webView:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame:]): Ditto.
     20        (-[UIDelegate webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:]): Ditto.
     21        (-[UIDelegate webView:setStatusText:]): Ditto.
     22
     23        * DumpRenderTree/win/DumpRenderTree.cpp:
     24        (dumpFramesAsText): Strip trailing spaces.
     25        * DumpRenderTree/win/FrameLoadDelegate.cpp:
     26        (FrameLoadDelegate::willPerformClientRedirectToURL): Don't add trailing space.
     27        * DumpRenderTree/win/UIDelegate.cpp:
     28        (toMessage): Changed to return std::wstring.
     29        (stripTrailingSpaces): Added.
     30        (addLeadingSpaceStripTrailingSpaces): Added.
     31        (UIDelegate::runJavaScriptAlertPanelWithMessage): Don't add trailing space.
     32        (UIDelegate::runJavaScriptConfirmPanelWithMessage): Ditto.
     33        (UIDelegate::runJavaScriptTextInputPanelWithPrompt): Ditto.
     34        (UIDelegate::runBeforeUnloadConfirmPanelWithMessage): Ditto.
     35        (UIDelegate::webViewAddMessageToConsole): Ditto.
     36        (UIDelegate::setStatusText): Ditto.
     37
     38        * Scripts/webkitpy/port/base.py:
     39        (Port.do_text_results_differ): Strip trailing spaces from expected text.
     40        Plan is to remove this after stripping the actual expected.txt files.
     41
     42        * Scripts/webkitpy/port/win.py:
     43        (WinPort.do_text_results_differ): Call through to base.
     44
     45        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
     46        (WTR::dumpFrameText): Strip trailing spaces.
     47        (WTR::InjectedBundlePage::willPerformClientRedirectForFrame): Don't add trailing space.
     48        (WTR::InjectedBundlePage::decidePolicyForNavigationAction): Ditto.
     49        (WTR::stripTrailingSpaces): Added.
     50        (WTR::addLeadingSpaceStripTrailingSpaces): Added.
     51        (WTR::InjectedBundlePage::willAddMessageToConsole): Don't add trailing space.
     52        (WTR::InjectedBundlePage::willRunJavaScriptAlert): Ditto.
     53        (WTR::InjectedBundlePage::willRunJavaScriptConfirm): Ditto.
     54        (WTR::InjectedBundlePage::willRunJavaScriptPrompt): Ditto.
     55
    1562020-09-25  Alex Christensen  <achristensen@webkit.org>
    257
  • trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm

    r267592 r267640  
    15161516    }
    15171517
     1518    // To keep things tidy, strip all trailing spaces: they are not a meaningful part of dumpAsText test output.
     1519    [result replaceOccurrencesOfString:@" +\n" withString:@"\n" options:NSRegularExpressionSearch range:NSMakeRange(0, result.length)];
     1520    [result replaceOccurrencesOfString:@" +$" withString:@"" options:NSRegularExpressionSearch range:NSMakeRange(0, result.length)];
     1521
    15181522    return result;
    15191523}
  • trunk/Tools/DumpRenderTree/mac/EventSendingController.mm

    r263396 r267640  
    12711271   
    12721272    if ([event isKindOfClass:[DOMKeyboardEvent class]]) {
    1273         printf("  keyIdentifier: %s\n", [[(DOMKeyboardEvent*)event keyIdentifier] UTF8String]);
     1273        auto keyIdentifier = [(DOMKeyboardEvent*)event keyIdentifier];
     1274        printf("  keyIdentifier:%s%s\n", keyIdentifier.length ? " " : "", [keyIdentifier UTF8String]);
    12741275        printf("  keyLocation:   %d\n", [(DOMKeyboardEvent*)event location]);
    12751276        printf("  modifier keys: c:%d s:%d a:%d m:%d\n",
  • trunk/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm

    r266988 r267640  
    413413{
    414414    if (!done && gTestRunner->dumpFrameLoadCallbacks()) {
    415         NSString *string = [NSString stringWithFormat:@"%@ - willPerformClientRedirectToURL: %@ ", [frame _drt_descriptionSuitableForTestResult], [URL _drt_descriptionSuitableForTestResult]];
     415        NSString *string = [NSString stringWithFormat:@"%@ - willPerformClientRedirectToURL: %@", [frame _drt_descriptionSuitableForTestResult], [URL _drt_descriptionSuitableForTestResult]];
    416416        printf ("%s\n", [string UTF8String]);
    417417    }
  • trunk/Tools/DumpRenderTree/mac/UIDelegate.mm

    r260485 r267640  
    7777}
    7878
     79static NSString *stripTrailingSpaces(NSString *string)
     80{
     81    auto result = [string stringByReplacingOccurrencesOfString:@" +\n" withString:@"\n" options:NSRegularExpressionSearch range:NSMakeRange(0, string.length)];
     82    return [result stringByReplacingOccurrencesOfString:@" +$" withString:@"" options:NSRegularExpressionSearch range:NSMakeRange(0, result.length)];
     83}
     84
     85static NSString *addLeadingSpaceStripTrailingSpaces(NSString *string)
     86{
     87    auto result = stripTrailingSpaces(string);
     88    return (result.length && ![result hasPrefix:@"\n"]) ? [@" " stringByAppendingString:result] : result;
     89}
     90
    7991- (void)webView:(WebView *)sender addMessageToConsole:(NSDictionary *)dictionary withSource:(NSString *)source
    8092{
     
    88100        message = [[message substringToIndex:range.location] stringByAppendingString:[[message substringFromIndex:NSMaxRange(range)] lastPathComponent]];
    89101
    90     auto out = gTestRunner->dumpJSConsoleLogInStdErr() ? stderr : stdout;
    91     fprintf(out, "CONSOLE MESSAGE: ");
    92     fprintf(out, "%s\n", [message UTF8String]);
     102    fprintf(gTestRunner->dumpJSConsoleLogInStdErr() ? stderr : stdout, "CONSOLE MESSAGE:%s\n", addLeadingSpaceStripTrailingSpaces(message).UTF8String ?: " (null)");
    93103}
    94104
     
    114124{
    115125    if (!done) {
    116         printf("ALERT: %s\n", [message UTF8String]);
     126        printf("ALERT:%s\n", addLeadingSpaceStripTrailingSpaces(message).UTF8String ?: " (null)");
    117127        fflush(stdout);
    118128    }
     
    122132{
    123133    if (!done)
    124         printf("CONFIRM: %s\n", [message UTF8String]);
     134        printf("CONFIRM:%s\n", addLeadingSpaceStripTrailingSpaces(message).UTF8String ?: " (null)");
    125135    return YES;
    126136}
     
    129139{
    130140    if (!done)
    131         printf("PROMPT: %s, default text: %s\n", [prompt UTF8String], [defaultText UTF8String]);
     141        printf("PROMPT: %s, default text:%s\n", prompt.UTF8String, addLeadingSpaceStripTrailingSpaces(defaultText).UTF8String ?: " (null)");
    132142    return defaultText;
    133143}
     
    136146{
    137147    if (!done)
    138         printf("CONFIRM NAVIGATION: %s\n", [message UTF8String]);
    139    
     148        printf("CONFIRM NAVIGATION:%s\n", addLeadingSpaceStripTrailingSpaces(message).UTF8String ?: " (null)");
    140149    return !gTestRunner->shouldStayOnPageAfterHandlingBeforeUnload();
    141150}
     
    236245{
    237246    if (!done && gTestRunner->dumpStatusCallbacks())
    238         printf("UI DELEGATE STATUS CALLBACK: setStatusText:%s\n", [text UTF8String]);
     247        printf("UI DELEGATE STATUS CALLBACK: setStatusText:%s\n", stripTrailingSpaces(text).UTF8String);
    239248}
    240249
  • trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp

    r267592 r267640  
    489489    }
    490490
     491    // To keep things tidy, strip all trailing spaces: they are not a meaningful part of dumpAsText test output.
     492    std::wstring::size_type spacePosition;
     493    while ((spacePosition = result.find(L" \n")) != std::wstring::npos)
     494        result.erase(spacePosition, 1);
     495    while (!result.empty() && result.back() == ' ')
     496        result.pop_back();
     497
    491498    return result;
    492499}
  • trunk/Tools/DumpRenderTree/win/FrameLoadDelegate.cpp

    r266988 r267640  
    293293{
    294294    if (!done && gTestRunner->dumpFrameLoadCallbacks())
    295         fprintf(testResult, "%s - willPerformClientRedirectToURL: %S \n", descriptionSuitableForTestResult(frame).c_str(),
     295        fprintf(testResult, "%s - willPerformClientRedirectToURL: %S\n", descriptionSuitableForTestResult(frame).c_str(),
    296296                urlSuitableForTestResult(std::wstring(url, ::SysStringLen(url))).c_str());
    297297
  • trunk/Tools/DumpRenderTree/win/UIDelegate.cpp

    r263379 r267640  
    11/*
    2  * Copyright (C) 2005-2008, 2014-2015 Apple Inc. All rights reserved.
     2 * Copyright (C) 2005-2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    454454}
    455455
    456 const wchar_t* toMessage(const BSTR message)
     456static std::string stripTrailingSpaces(const std::string& string)
     457{
     458    auto result = string;
     459    std::wstring::size_type spacePosition;
     460    while ((spacePosition = result.find(" \n")) != std::wstring::npos)
     461        result.erase(spacePosition, 1);
     462    while (!result.empty() && result.back() == ' ')
     463        result.pop_back();
     464    return result;
     465}
     466
     467static std::string addLeadingSpaceStripTrailingSpaces(const std::string& string)
     468{
     469    auto result = stripTrailingSpaces(string);
     470    return (result.empty() || result.front() == '\n') ? result : ' ' + result;
     471}
     472
     473static std::string addLeadingSpaceStripTrailingSpaces(const std::wstring& string)
     474{
     475    return addLeadingSpaceStripTrailingSpaces(toUTF8(string));
     476}
     477
     478std::string toMessage(BSTR message)
    457479{
    458480    auto length = SysStringLen(message);
    459481    if (!length)
    460         return message;
     482        return "";
    461483    // Return "(null)" for an invalid UTF-16 sequence to align with WebKitTestRunner.
    462     auto utf8 = StringView(ucharFrom(message), length).tryGetUtf8(StrictConversion);
    463     if (!utf8)
    464         return L"(null)";
    465     return message;
     484    // FIXME: Could probably take advantage of WC_ERR_INVALID_CHARS and avoid converting to UTF-8 twice.
     485    if (!StringView(ucharFrom(message), length).tryGetUtf8(StrictConversion))
     486        return "(null)";
     487    return toUTF8(message);
     488}
     489
     490static std::string addLeadingSpaceStripTrailingSpaces(BSTR message)
     491{
     492    return addLeadingSpaceStripTrailingSpaces(toMessage(message));
     493}
     494
     495static std::string stripTrailingSpaces(BSTR message)
     496{
     497    return stripTrailingSpaces(toMessage(message));
    466498}
    467499
     
    469501{
    470502    if (!done) {
    471         fprintf(testResult, "ALERT: %S\n", toMessage(message));
     503        fprintf(testResult, "ALERT:%s\n", addLeadingSpaceStripTrailingSpaces(message).c_str());
    472504        fflush(testResult);
    473505    }
     
    479511{
    480512    if (!done)
    481         fprintf(testResult, "CONFIRM: %S\n", toMessage(message));
     513        fprintf(testResult, "CONFIRM:%s\n", addLeadingSpaceStripTrailingSpaces(message).c_str());
    482514
    483515    *result = TRUE;
     
    489521{
    490522    if (!done)
    491         fprintf(testResult, "PROMPT: %S, default text: %S\n", toMessage(message), toMessage(defaultText));
     523        fprintf(testResult, "PROMPT: %s, default text:%s\n", toMessage(message).c_str(), addLeadingSpaceStripTrailingSpaces(defaultText).c_str());
    492524
    493525    *result = SysAllocString(defaultText);
     
    502534
    503535    if (!done)
    504         fprintf(testResult, "CONFIRM NAVIGATION: %S\n", toMessage(message));
     536        fprintf(testResult, "CONFIRM NAVIGATION:%s\n", addLeadingSpaceStripTrailingSpaces(message).c_str());
    505537
    506538    *result = !gTestRunner->shouldStayOnPageAfterHandlingBeforeUnload();
     
    524556
    525557    auto out = gTestRunner->dumpJSConsoleLogInStdErr() ? stderr : testResult;
    526     fprintf(out, "CONSOLE MESSAGE: ");
    527     fprintf(out, "%s\n", toUTF8(newMessage).c_str());
     558    fprintf(out, "CONSOLE MESSAGE:%s\n", addLeadingSpaceStripTrailingSpaces(newMessage).c_str());
    528559    return S_OK;
    529560}
     
    674705{
    675706    if (!done && gTestRunner->dumpStatusCallbacks())
    676         fprintf(testResult, "UI DELEGATE STATUS CALLBACK: setStatusText:%S\n", toMessage(text));
     707        fprintf(testResult, "UI DELEGATE STATUS CALLBACK: setStatusText:%s\n", stripTrailingSpaces(text).c_str());
    677708    return S_OK;
    678709}
  • trunk/Tools/Scripts/webkitpy/port/base.py

    r266638 r267640  
    301301
    302302    def do_text_results_differ(self, expected_text, actual_text):
     303        # Ignore trailing spaces in expected files. We will remove this code after removing trailing spaces from all expected.txt files.
     304        if not expected_text.startswith("<?xml"):
     305            expected_text = re.compile(" +$", re.MULTILINE).sub("", expected_text)
    303306        return expected_text != actual_text
    304307
  • trunk/Tools/Scripts/webkitpy/port/win.py

    r265191 r267640  
    104104
    105105    def do_text_results_differ(self, expected_text, actual_text):
    106         # Sanity was restored in WK2, so we don't need this hack there.
    107         if self.get_option('webkit_test_runner'):
    108             return ApplePort.do_text_results_differ(self, expected_text, actual_text)
    109 
    110         # This is a hack (which dates back to ORWT).
    111         # Windows does not have an EDITING DELEGATE, so we strip any EDITING DELEGATE
    112         # messages to make more of the tests pass.
    113         # It's possible more of the ports might want this and this could move down into WebKitPort.
    114         delegate_regexp = re.compile("^EDITING DELEGATE: .*?\n", re.MULTILINE)
    115         expected_text = delegate_regexp.sub("", expected_text)
    116         actual_text = delegate_regexp.sub("", actual_text)
    117         return expected_text != actual_text
     106        # Sanity was restored in WebKitTestRunner, so we don't need this hack there.
     107        if not self.get_option('webkit_test_runner'):
     108            # Windows does not have an EDITING DELEGATE, so strip those messages to make more tests pass.
     109            # It's possible other ports might want this, and if so, this could move down into WebKitPort.
     110            delegate_regexp = re.compile("^EDITING DELEGATE: .*?\n", re.MULTILINE)
     111            expected_text = delegate_regexp.sub("", expected_text)
     112            actual_text = delegate_regexp.sub("", actual_text)
     113        return ApplePort.do_text_results_differ(self, expected_text, actual_text)
    118114
    119115    def default_baseline_search_path(self, **kwargs):
  • trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp

    r266988 r267640  
    835835}
    836836
    837 static void dumpFrameText(WKBundleFrameRef frame, StringBuilder& stringBuilder)
     837static void dumpFrameText(WKBundleFrameRef frame, StringBuilder& builder)
    838838{
    839839    // If the frame doesn't have a document element, its inner text will be an empty string, so
    840     // we'll end up just appending a single newline below. But DumpRenderTree doesn't append
    841     // anything in this case, so we shouldn't either.
     840    // we'll end up just appending a single newline below. Since DumpRenderTree didn't append
     841    // anything in this case, we decided to preserve that behavior.
    842842    if (!hasDocumentElement(frame))
    843843        return;
    844844
    845     WKRetainPtr<WKStringRef> text = adoptWK(WKBundleFrameCopyInnerText(frame));
    846     stringBuilder.append(toWTFString(text));
    847     stringBuilder.append('\n');
     845    // To keep things tidy, strip all trailing spaces: they are not a meaningful part of dumpAsText test output.
     846    // Breaking the string up into lines lets us efficiently strip and has a side effect of adding a newline after the last line.
     847    auto text = toWTFString(adoptWK(WKBundleFrameCopyInnerText(frame)));
     848    for (auto line : StringView(text).splitAllowingEmptyEntries('\n')) {
     849        while (line.endsWith(' '))
     850            line = line.substring(0, line.length() - 1);
     851        builder.append(line, '\n');
     852    }
    848853}
    849854
     
    10571062    StringBuilder stringBuilder;
    10581063    dumpFrameDescriptionSuitableForTestResult(frame, stringBuilder);
    1059     stringBuilder.appendLiteral(" - willPerformClientRedirectToURL: ");
    1060     stringBuilder.append(pathSuitableForTestResult(url));
    1061     stringBuilder.appendLiteral(" \n");
     1064    stringBuilder.append(" - willPerformClientRedirectToURL: ", pathSuitableForTestResult(url), '\n');
    10621065    injectedBundle.outputText(stringBuilder.toString());
    10631066}
     
    13461349    if (injectedBundle.testRunner()->shouldDumpPolicyCallbacks()) {
    13471350        StringBuilder stringBuilder;
    1348         stringBuilder.appendLiteral(" - decidePolicyForNavigationAction \n");
     1351        stringBuilder.appendLiteral(" - decidePolicyForNavigationAction\n");
    13491352        dumpRequestDescriptionSuitableForTestResult(request, stringBuilder);
    13501353        stringBuilder.appendLiteral(" is main frame - ");
     
    14501453}
    14511454
     1455static WTF::String stripTrailingSpacesAddNewline(const WTF::String& string)
     1456{
     1457    StringBuilder builder;
     1458    for (auto line : StringView(string).splitAllowingEmptyEntries('\n')) {
     1459        while (line.endsWith(' '))
     1460            line = line.substring(0, line.length() - 1);
     1461        builder.append(line, '\n');
     1462    }
     1463    return builder.toString();
     1464}
     1465
     1466static WTF::String addLeadingSpaceStripTrailingSpacesAddNewline(const WTF::String& string)
     1467{
     1468    auto result = stripTrailingSpacesAddNewline(string);
     1469    return (result.isEmpty() || result.startsWith('\n')) ? result : makeString(' ', result);
     1470}
     1471
    14521472static WTF::String lastFileURLPathComponent(const WTF::String& path)
    14531473{
     
    14861506        messageString = messageString.substring(0, fileProtocolStart) + lastFileURLPathComponent(messageString.substring(fileProtocolStart));
    14871507
    1488     StringBuilder stringBuilder;
    1489     stringBuilder.appendLiteral("CONSOLE MESSAGE: ");
    1490     stringBuilder.append(messageString);
    1491     stringBuilder.append('\n');
    1492 
     1508    messageString = makeString("CONSOLE MESSAGE:", addLeadingSpaceStripTrailingSpacesAddNewline(messageString));
    14931509    if (injectedBundle.dumpJSConsoleLogInStdErr())
    1494         injectedBundle.dumpToStdErr(stringBuilder.toString());
     1510        injectedBundle.dumpToStdErr(messageString);
    14951511    else
    1496         injectedBundle.outputText(stringBuilder.toString());
     1512        injectedBundle.outputText(messageString);
    14971513}
    14981514
     
    15191535        return;
    15201536
    1521     StringBuilder stringBuilder;
    1522     stringBuilder.appendLiteral("ALERT: ");
    1523     stringBuilder.append(toWTFString(message));
    1524     stringBuilder.append('\n');
    1525     injectedBundle.outputText(stringBuilder.toString());
     1537    injectedBundle.outputText(makeString("ALERT:", addLeadingSpaceStripTrailingSpacesAddNewline(toWTFString(message))));
    15261538}
    15271539
     
    15321544        return;
    15331545
    1534     StringBuilder stringBuilder;
    1535     stringBuilder.appendLiteral("CONFIRM: ");
    1536     stringBuilder.append(toWTFString(message));
    1537     stringBuilder.append('\n');
    1538     injectedBundle.outputText(stringBuilder.toString());
     1546    injectedBundle.outputText(makeString("CONFIRM:", addLeadingSpaceStripTrailingSpacesAddNewline(toWTFString(message))));
    15391547}
    15401548
    15411549void InjectedBundlePage::willRunJavaScriptPrompt(WKStringRef message, WKStringRef defaultValue, WKBundleFrameRef)
    15421550{
    1543     StringBuilder stringBuilder;
    1544     stringBuilder.appendLiteral("PROMPT: ");
    1545     stringBuilder.append(toWTFString(message));
    1546     stringBuilder.appendLiteral(", default text: ");
    1547     stringBuilder.append(toWTFString(defaultValue));
    1548     stringBuilder.append('\n');
    1549     InjectedBundle::singleton().outputText(stringBuilder.toString());
     1551    InjectedBundle::singleton().outputText(makeString("PROMPT: ", toWTFString(message), ", default text:", addLeadingSpaceStripTrailingSpacesAddNewline(toWTFString(defaultValue))));
    15501552}
    15511553
Note: See TracChangeset for help on using the changeset viewer.