Changeset 202401 in webkit


Ignore:
Timestamp:
Jun 23, 2016 4:22:21 PM (8 years ago)
Author:
BJ Burg
Message:

Web Inspector: add assertions to catch dangling frontends that persist between tests
https://bugs.webkit.org/show_bug.cgi?id=159073

Reviewed by Joseph Pecoraro.

Based on the analysis in https://webkit.org/b/159070, we suspect that some test
flakiness might be caused by dangling frontends from previous test cases. Add an
assertion that should catch any frontends that are attached to the inspected page's
backend. There should never be any frontends connected when a test first starts.

  • inspector/InspectorController.cpp:

(WebCore::InspectorController::setIsUnderTest):

  • inspector/InspectorController.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r202399 r202401  
     12016-06-23  Brian Burg  <bburg@apple.com>
     2
     3        Web Inspector: add assertions to catch dangling frontends that persist between tests
     4        https://bugs.webkit.org/show_bug.cgi?id=159073
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        Based on the analysis in https://webkit.org/b/159070, we suspect that some test
     9        flakiness might be caused by dangling frontends from previous test cases. Add an
     10        assertion that should catch any frontends that are attached to the inspected page's
     11        backend. There should never be any frontends connected when a test first starts.
     12
     13        * inspector/InspectorController.cpp:
     14        (WebCore::InspectorController::setIsUnderTest):
     15        * inspector/InspectorController.h:
     16
    1172016-06-23  Said Abou-Hallawa  <sabouhallawa@apple.com>
    218
  • trunk/Source/WebCore/inspector/InspectorController.cpp

    r202383 r202401  
    342342}
    343343
     344void InspectorController::setIsUnderTest(bool value)
     345{
     346    if (value == m_isUnderTest)
     347        return;
     348
     349    m_isUnderTest = value;
     350
     351    // <rdar://problem/26768628> Try to catch suspicious scenarios where we may have a dangling frontend while running tests.
     352    RELEASE_ASSERT(!m_isUnderTest || !m_frontendRouter->hasFrontends());
     353}
     354
    344355void InspectorController::evaluateForTestInFrontend(const String& script)
    345356{
  • trunk/Source/WebCore/inspector/InspectorController.h

    r201237 r202401  
    108108
    109109    bool isUnderTest() const { return m_isUnderTest; }
    110     void setIsUnderTest(bool isUnderTest) { m_isUnderTest = isUnderTest; }
     110    WEBCORE_EXPORT void setIsUnderTest(bool);
    111111    WEBCORE_EXPORT void evaluateForTestInFrontend(const String& script);
    112112
Note: See TracChangeset for help on using the changeset viewer.