Changeset 46539 in webkit


Ignore:
Timestamp:
Jul 29, 2009 6:18:30 AM (15 years ago)
Author:
Nikolas Zimmermann
Message:

2009-07-29 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com>

Reviewed by Adam Treat.

[WML] Running WML tests in random order multiple times exposes subtle bugs
https://bugs.webkit.org/show_bug.cgi?id=27801

Some changes to fix random order WML tests, simplilfy WMLTestCase.js and reset testDocument
properly in enter-first-card-with-events.js. fast/wml/err-multi-access.wml still creates a layout
test difference on consecutive runs, though that's related to bug 27721, which has to be fixed first.

  • wml/resources/WMLTestCase.js:
  • wml/resources/enter-first-card-with-events.js: (setupTestDocument): (prepareTest): (executeTest):

2009-07-29 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com>

Reviewed by Adam Treat.

[WML] Running WML tests in random order multiple times exposes subtle bugs
https://bugs.webkit.org/show_bug.cgi?id=27801

Remove superflous assertions regarding the parent node. Under certain circumstances
these can even fire (related to garbage collection while destructing). Fixes random order
WML tests (run-webkit-tests fast/wml wml http/tests/wml fast/wml ... --random)

The wml/enter-first-card-with-events.html test relied on a bug in our implementation of
WMLPageState::reset() - the history stack should still contain the current card afterwards.
Fix that bug by preserving the first item in BackForwardList::clearWMLPageHistory().

  • history/BackForwardList.cpp: Preserve first item in history stack, as demanded by the spec. (WebCore::BackForwardList::clearWMLPageHistory):
  • wml/WMLDoElement.cpp: (WebCore::WMLDoElement::insertedIntoDocument): (WebCore::WMLDoElement::removedFromDocument):
  • wml/WMLNoopElement.cpp: (WebCore::WMLNoopElement::insertedIntoDocument):
  • wml/WMLOnEventElement.cpp: (WebCore::eventHandlingParent):
  • wml/WMLPostfieldElement.cpp: (WebCore::WMLPostfieldElement::insertedIntoDocument): (WebCore::WMLPostfieldElement::removedFromDocument):
  • wml/WMLSetvarElement.cpp: (WebCore::WMLSetvarElement::insertedIntoDocument): (WebCore::WMLSetvarElement::removedFromDocument):
  • wml/WMLTaskElement.cpp: (WebCore::WMLTaskElement::insertedIntoDocument): (WebCore::WMLTaskElement::removedFromDocument):
  • wml/WMLTimerElement.cpp: (WebCore::WMLTimerElement::insertedIntoDocument): (WebCore::WMLTimerElement::removedFromDocument):
Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r46537 r46539  
     12009-07-29  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
     2
     3        Reviewed by Adam Treat.
     4
     5        [WML] Running WML tests in random order multiple times exposes subtle bugs
     6        https://bugs.webkit.org/show_bug.cgi?id=27801
     7
     8        Some changes to fix random order WML tests, simplilfy WMLTestCase.js and reset testDocument
     9        properly in enter-first-card-with-events.js. fast/wml/err-multi-access.wml still creates a layout
     10        test difference on consecutive runs, though that's related to bug 27721, which has to be fixed first.
     11
     12        * wml/resources/WMLTestCase.js:
     13        * wml/resources/enter-first-card-with-events.js:
     14        (setupTestDocument):
     15        (prepareTest):
     16        (executeTest):
     17
    1182009-07-29  Jan Michael Alonzo  <jmalonzo@webkit.org>
    219
  • trunk/LayoutTests/wml/resources/WMLTestCase.js

    r46418 r46539  
    1010}
    1111
    12 function createWMLTestCase(testDescription, substitutesVariables, testName, executeImmediately, needsReset) {
     12function createWMLTestCase(testDescription, substitutesVariables, testName, executeImmediately) {
    1313    // Setup default test options
    14     if (substitutesVariables == null) {
     14    if (substitutesVariables == null)
    1515        substitutesVariables = true;
    16     }
    1716
    1817    // Setup default test name
     
    2019        executeImmediately = false; // Only honored, when testName != null
    2120        testName = relativePathToLayoutTests + "/wml/resources/test-document.wml";
    22     } else if (executeImmediately == null) {
     21    } else if (executeImmediately == null)
    2322        executeImmediately = true;
    24     }
    25 
    26     // Some tests may want to handle resetting the page state themselves
    27     if (needsReset == null) {
    28         needsReset = true;
    29     }
    3023
    3124    // Initialize JS test
     
    3427
    3528    // Clear variable state & history
    36     if (needsReset)
    37         document.resetWMLPageState();
     29    document.resetWMLPageState();
    3830
    3931    // Setup DRT specific settings
  • trunk/LayoutTests/wml/resources/enter-first-card-with-events.js

    r46418 r46539  
    11/// [Name] enter-first-card-with-events.js
    22
    3 createWMLTestCase("Tests entering first card backwards that has intrinsic events set", false, "resources/enter-first-card-with-events.wml", false, false);
    4 
    5 var ranOnce = false;
    6 var resultIndicatorElement;
     3createWMLTestCase("Tests entering first card backwards that has intrinsic events set", false, "resources/enter-first-card-with-events.wml", false);
    74
    85function setupTestDocument() {
    9     resultIndicatorElement = testDocument.getElementById("resultIndicator");
     6    var resultIndicatorElement = testDocument.getElementById("resultIndicator");
     7    if (resultIndicatorElement.textContent == "DONE")
     8        completeTest();
    109}
    1110
    1211function prepareTest() {
    13     if (resultIndicatorElement.textContent == "DONE")
    14         completeTest();
    15     else
    16         executeTest();
     12    startTest(25, 15);
    1713}
    1814
    1915function executeTest() {
    2016    startTest(25, 15);
     17
     18    // Force re-setup of the test document, as we check for completion upon setupTestDocument()
     19    testDocument = undefined;
    2120}
    2221
  • trunk/WebCore/ChangeLog

    r46535 r46539  
     12009-07-29  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
     2
     3        Reviewed by Adam Treat.
     4
     5        [WML] Running WML tests in random order multiple times exposes subtle bugs
     6        https://bugs.webkit.org/show_bug.cgi?id=27801
     7
     8        Remove superflous assertions regarding the parent node. Under certain circumstances
     9        these can even fire (related to garbage collection while destructing). Fixes random order
     10        WML tests (run-webkit-tests fast/wml wml http/tests/wml fast/wml ... --random)
     11
     12        The wml/enter-first-card-with-events.html test relied on a bug in our implementation of
     13        WMLPageState::reset() - the history stack should still contain the current card afterwards.
     14        Fix that bug by preserving the first item in BackForwardList::clearWMLPageHistory().
     15
     16        * history/BackForwardList.cpp: Preserve first item in history stack, as demanded by the spec.
     17        (WebCore::BackForwardList::clearWMLPageHistory):
     18        * wml/WMLDoElement.cpp:
     19        (WebCore::WMLDoElement::insertedIntoDocument):
     20        (WebCore::WMLDoElement::removedFromDocument):
     21        * wml/WMLNoopElement.cpp:
     22        (WebCore::WMLNoopElement::insertedIntoDocument):
     23        * wml/WMLOnEventElement.cpp:
     24        (WebCore::eventHandlingParent):
     25        * wml/WMLPostfieldElement.cpp:
     26        (WebCore::WMLPostfieldElement::insertedIntoDocument):
     27        (WebCore::WMLPostfieldElement::removedFromDocument):
     28        * wml/WMLSetvarElement.cpp:
     29        (WebCore::WMLSetvarElement::insertedIntoDocument):
     30        (WebCore::WMLSetvarElement::removedFromDocument):
     31        * wml/WMLTaskElement.cpp:
     32        (WebCore::WMLTaskElement::insertedIntoDocument):
     33        (WebCore::WMLTaskElement::removedFromDocument):
     34        * wml/WMLTimerElement.cpp:
     35        (WebCore::WMLTimerElement::insertedIntoDocument):
     36        (WebCore::WMLTimerElement::removedFromDocument):
     37
    1382009-07-29  Yongjun Zhang  <yongjun.zhang@nokia.com>
    239
  • trunk/WebCore/history/BackForwardList.cpp

    r46418 r46539  
    269269void BackForwardList::clearWMLPageHistory()
    270270{
     271    RefPtr<HistoryItem> currentItem = this->currentItem();
     272
    271273    int size = m_entries.size();
    272274    for (int i = 0; i < size; ++i)
     
    276278    m_entryHash.clear();
    277279    m_current = NoCurrentItemIndex;
     280
     281    // Spec: The history stack may be reset to a state where it only contains the current card.
     282    addItem(currentItem);
    278283}
    279284#endif
  • trunk/WebCore/wml/WMLDoElement.cpp

    r46510 r46539  
    114114
    115115    Node* parent = parentNode();
    116     ASSERT(parent);
    117 
    118116    if (!parent || !parent->isWMLElement())
    119117        return;
     
    126124{
    127125    Node* parent = parentNode();
    128     ASSERT(parent);
    129126
    130127    if (parent  && parent->isWMLElement()) {
  • trunk/WebCore/wml/WMLNoopElement.cpp

    r46474 r46539  
    4646
    4747    Node* parent = parentNode();
    48     ASSERT(parent);
    49 
    5048    if (!parent || !parent->isWMLElement())
    5149        return;
  • trunk/WebCore/wml/WMLOnEventElement.cpp

    r46510 r46539  
    6363static inline WMLEventHandlingElement* eventHandlingParent(Node* parent)
    6464{
    65     ASSERT(parent);
    6665    if (!parent || !parent->isWMLElement())
    6766        return 0;
  • trunk/WebCore/wml/WMLPostfieldElement.cpp

    r46510 r46539  
    4545
    4646    Node* parent = parentNode();
    47     ASSERT(parent);
    48 
    49     if (!parent->hasTagName(goTag))
    50         return;
    51 
    52     static_cast<WMLGoElement*>(parent)->registerPostfieldElement(this);
     47    if (parent && parent->hasTagName(goTag))
     48        static_cast<WMLGoElement*>(parent)->registerPostfieldElement(this);
    5349}
    5450
     
    5652{
    5753    Node* parent = parentNode();
    58     ASSERT(parent);
    59 
    60     if (parent->hasTagName(goTag))
     54    if (parent && parent->hasTagName(goTag))
    6155        static_cast<WMLGoElement*>(parent)->deregisterPostfieldElement(this);
    6256
  • trunk/WebCore/wml/WMLSetvarElement.cpp

    r46510 r46539  
    5757 
    5858    Node* parent = parentNode();
    59     ASSERT(parent);
    60 
    6159    if (!parent || !parent->isWMLElement())
    6260        return;
     
    6967{
    7068    Node* parent = parentNode();
    71     ASSERT(parent);
    72 
    7369    if (parent && parent->isWMLElement()) {
    7470        if (static_cast<WMLElement*>(parent)->isWMLTaskElement())
  • trunk/WebCore/wml/WMLTaskElement.cpp

    r46510 r46539  
    4949
    5050    Node* parent = parentNode();
    51     ASSERT(parent);
    52 
    5351    if (!parent || !parent->isWMLElement())
    5452        return;
     
    6563{
    6664    Node* parent = parentNode();
    67     ASSERT(parent);
    68 
    6965    if (parent && parent->isWMLElement()) {
    7066        if (parent->hasTagName(anchorTag))
  • trunk/WebCore/wml/WMLTimerElement.cpp

    r46510 r46539  
    6060
    6161    Node* parent = parentNode();
    62     ASSERT(parent);
    63 
    6462    if (!parent || !parent->isWMLElement())
    6563        return;
     
    7472{
    7573    Node* parent = parentNode();
    76     ASSERT(parent);
    77 
    78     if (parent && parent->isWMLElement()) {
    79         if (parent->hasTagName(cardTag)) {
    80             m_card->setIntrinsicEventTimer(0);
    81             m_card = 0;
    82         }
     74    if (parent && parent->isWMLElement() && parent->hasTagName(cardTag)) {
     75        m_card->setIntrinsicEventTimer(0);
     76        m_card = 0;
    8377    }
    8478
Note: See TracChangeset for help on using the changeset viewer.