Changeset 86417 in webkit


Ignore:
Timestamp:
May 13, 2011 12:20:02 AM (13 years ago)
Author:
ap@apple.com
Message:

2011-05-13 Alexey Proskuryakov <ap@apple.com>

Unreviewed test changes.

Web Inspector: Show Error Messages for Application Cache Errors
https://bugs.webkit.org/show_bug.cgi?id=41642

  • http/tests/appcache/404-resource-expected.txt:
  • http/tests/appcache/manifest-redirect-expected.txt:
  • http/tests/appcache/origin-quota-expected.txt:
  • http/tests/appcache/resource-redirect-2-expected.txt:
  • http/tests/appcache/resource-redirect-expected.txt:
  • http/tests/appcache/wrong-content-type-expected.txt:
  • http/tests/appcache/wrong-signature-2-expected.txt:
  • http/tests/appcache/wrong-signature-expected.txt:

2011-05-13 Alexey Proskuryakov <ap@apple.com>

Reviewed by Pavel Feldman.

Web Inspector: Show Error Messages for Application Cache Errors
https://bugs.webkit.org/show_bug.cgi?id=41642

  • loader/appcache/ApplicationCacheGroup.cpp: (WebCore::ApplicationCacheGroup::didReceiveResponse): (WebCore::ApplicationCacheGroup::didFail): (WebCore::ApplicationCacheGroup::didReceiveManifestResponse): (WebCore::ApplicationCacheGroup::didFinishLoadingManifest): (WebCore::ApplicationCacheGroup::cacheUpdateFailedDueToOriginQuota): Added console error logging.
Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r86413 r86417  
     12011-05-13  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Unreviewed test changes.
     4
     5        Web Inspector: Show Error Messages for Application Cache Errors
     6        https://bugs.webkit.org/show_bug.cgi?id=41642
     7
     8        * http/tests/appcache/404-resource-expected.txt:
     9        * http/tests/appcache/manifest-redirect-expected.txt:
     10        * http/tests/appcache/origin-quota-expected.txt:
     11        * http/tests/appcache/resource-redirect-2-expected.txt:
     12        * http/tests/appcache/resource-redirect-expected.txt:
     13        * http/tests/appcache/wrong-content-type-expected.txt:
     14        * http/tests/appcache/wrong-signature-2-expected.txt:
     15        * http/tests/appcache/wrong-signature-expected.txt:
     16
    1172011-05-12  Ben Wells  <benwells@chromium.org>
    218
  • trunk/LayoutTests/http/tests/appcache/404-resource-expected.txt

    r40164 r86417  
     1CONSOLE MESSAGE: line 0: Application Cache update failed, because http://127.0.0.1:8000/appcache/resources/does-not-exist.txt could not be fetched.
    12Test that a missing explicit resource makes caching fail.
    23
  • trunk/LayoutTests/http/tests/appcache/manifest-redirect-expected.txt

    r40356 r86417  
     1CONSOLE MESSAGE: line 0: Application Cache manifest could not be fetched, because a redirection was attempted.
    12Test that a redirect makes resource caching fail.
    23
  • trunk/LayoutTests/http/tests/appcache/origin-quota-expected.txt

    r64613 r86417  
    11UI DELEGATE APPLICATION CACHE CALLBACK: exceededApplicationCacheOriginQuotaForSecurityOrigin:{http, 127.0.0.1, 8000}
     2CONSOLE MESSAGE: line 0: Application Cache update failed, because size quota was exceeded.
    23This test checks that per-origin application cache quotas are enforced.
    34
  • trunk/LayoutTests/http/tests/appcache/resource-redirect-2-expected.txt

    r40368 r86417  
     1CONSOLE MESSAGE: line 0: Application Cache update failed, because http://127.0.0.1:8000/appcache/resources/resource-redirect-2.php could not be fetched.
    12Test that a redirect makes resource caching fail.
    23
  • trunk/LayoutTests/http/tests/appcache/resource-redirect-expected.txt

    r40356 r86417  
     1CONSOLE MESSAGE: line 0: Application Cache update failed, because http://127.0.0.1:8000/appcache/resources/resource-redirect.php was redirected.
    12Test that a redirect makes resource caching fail.
    23
  • trunk/LayoutTests/http/tests/appcache/wrong-content-type-expected.txt

    r39550 r86417  
     1CONSOLE MESSAGE: line 0: Application Cache manifest had an incorrect MIME type: text/plain.
    12Test that a manifest served with a wrong content-type isn't treated as such.
    23
  • trunk/LayoutTests/http/tests/appcache/wrong-signature-2-expected.txt

    r40355 r86417  
     1CONSOLE MESSAGE: line 0: Application Cache manifest could not be parsed. Does it start with CACHE MANIFEST?
    12Test that a manifest served with a wrong signature isn't treated as such.
    23
  • trunk/LayoutTests/http/tests/appcache/wrong-signature-expected.txt

    r39550 r86417  
     1CONSOLE MESSAGE: line 0: Application Cache manifest could not be parsed. Does it start with CACHE MANIFEST?
    12Test that a manifest served with a wrong signature isn't treated as such.
    23
  • trunk/Source/WebCore/ChangeLog

    r86416 r86417  
     12011-05-13  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Web Inspector: Show Error Messages for Application Cache Errors
     6        https://bugs.webkit.org/show_bug.cgi?id=41642
     7
     8        * loader/appcache/ApplicationCacheGroup.cpp:
     9        (WebCore::ApplicationCacheGroup::didReceiveResponse):
     10        (WebCore::ApplicationCacheGroup::didFail):
     11        (WebCore::ApplicationCacheGroup::didReceiveManifestResponse):
     12        (WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
     13        (WebCore::ApplicationCacheGroup::cacheUpdateFailedDueToOriginQuota):
     14        Added console error logging.
     15
    1162011-05-12  Pratik Solanki  <psolanki@apple.com>
    217
  • trunk/Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp

    r86251 r86417  
    3535#include "Chrome.h"
    3636#include "ChromeClient.h"
     37#include "Console.h"
    3738#include "DOMApplicationCache.h"
    3839#include "DOMWindow.h"
     
    526527    if (response.httpStatusCode() / 100 != 2 || response.url() != m_currentHandle->firstRequest().url()) {
    527528        if ((type & ApplicationCacheResource::Explicit) || (type & ApplicationCacheResource::Fallback)) {
     529            m_frame->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, ErrorMessageLevel, "Application Cache update failed, because " + m_currentHandle->firstRequest().url().string() +
     530                ((response.httpStatusCode() / 100 != 2) ? " could not be fetched." : " was redirected."), 0, String());
    528531            // Note that cacheUpdateFailed() can cause the cache group to be deleted.
    529532            cacheUpdateFailed();
     
    623626
    624627    if (handle == m_manifestHandle) {
     628        // A network error is logged elsewhere, no need to log again. Also, it's normal for manifest fetching to fail when working offline.
    625629        cacheUpdateFailed();
    626630        return;
     
    637641
    638642    if ((type & ApplicationCacheResource::Explicit) || (type & ApplicationCacheResource::Fallback)) {
     643        m_frame->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, ErrorMessageLevel, "Application Cache update failed, because " + url.string() + " could not be fetched.", 0, String());
    639644        // Note that cacheUpdateFailed() can cause the cache group to be deleted.
    640645        cacheUpdateFailed();
     
    664669        return;
    665670
    666     if (response.httpStatusCode() / 100 != 2 || response.url() != m_manifestHandle->firstRequest().url() || !equalIgnoringCase(response.mimeType(), "text/cache-manifest")) {
     671    if (response.httpStatusCode() / 100 != 2) {
     672        m_frame->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, ErrorMessageLevel, "Application Cache manifest could not be fetched.", 0, String());
     673        cacheUpdateFailed();
     674        return;
     675    }
     676
     677    if (response.url() != m_manifestHandle->firstRequest().url()) {
     678        m_frame->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, ErrorMessageLevel, "Application Cache manifest could not be fetched, because a redirection was attempted.", 0, String());
     679        cacheUpdateFailed();
     680        return;
     681    }
     682
     683    if (!equalIgnoringCase(response.mimeType(), "text/cache-manifest")) {
     684        m_frame->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, ErrorMessageLevel, "Application Cache manifest had an incorrect MIME type: " + response.mimeType() + ".", 0, String());
    667685        cacheUpdateFailed();
    668686        return;
     
    684702    if (!isUpgradeAttempt && !m_manifestResource) {
    685703        // The server returned 304 Not Modified even though we didn't send a conditional request.
     704        m_frame->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, ErrorMessageLevel, "Application Cache manifest could not be fetched because of an unexpected 304 Not Modified server response.", 0, String());
    686705        cacheUpdateFailed();
    687706        return;
     
    708727    Manifest manifest;
    709728    if (!parseManifest(m_manifestURL, m_manifestResource->data()->data(), m_manifestResource->data()->size(), manifest)) {
     729        // At the time of this writing, lack of "CACHE MANIFEST" signature is the only reason for parseManifest to fail.
     730        m_frame->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, ErrorMessageLevel, "Application Cache manifest could not be parsed. Does it start with CACHE MANIFEST?", 0, String());
    710731        cacheUpdateFailed();
    711732        return;
     
    787808    }
    788809
     810    m_frame->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, ErrorMessageLevel, "Application Cache update failed, because size quota was exceeded.", 0, String());
     811
     812    // FIXME: Should not abort cache update - the user may choose to increase the quota.
    789813    cacheUpdateFailed();
    790814}
Note: See TracChangeset for help on using the changeset viewer.