Commit eca8abf8 authored by darin's avatar darin
Browse files

LayoutTests:

        - test <rdar://problem/4456287> REGRESSION: assertion failure at mypage.apple.com
          in WebCore::TimerBase::nextFireInterval() const + 100 (Timer.cpp:188)

        * fast/dom/Window/redirect-with-timer.html: Added.
        * fast/dom/Window/redirect-with-timer-expected.txt: Added.

WebCore:

        Reviewed by Maciej.

        - fix <rdar://problem/4456287> REGRESSION: assertion failure at mypage.apple.com
          in WebCore::TimerBase::nextFireInterval() const + 100 (Timer.cpp:188)

        Test: fast/dom/Window/redirect-with-timer.html

        * platform/Timer.h: Made isActive no longer inline. Added inHeap function.
        * platform/Timer.cpp: Changed assertions to use inHeap function for clarity.
        (WebCore::TimerBase::isActive): Return true for timers that are ready to fire.
        They have a next fire time of 0, but they should still be considered active.
        (WebCore::TimerBase::checkConsistency): Correct the consistency check. The new
        rule is that timers with a next fire time of 0 are not in the heap, and all other
        timers are.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@12985 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d2045190
2006-02-24 Darin Adler <darin@apple.com>
- test <rdar://problem/4456287> REGRESSION: assertion failure at mypage.apple.com
in WebCore::TimerBase::nextFireInterval() const + 100 (Timer.cpp:188)
* fast/dom/Window/redirect-with-timer.html: Added.
* fast/dom/Window/redirect-with-timer-expected.txt: Added.
2006-02-24 Graham Dennis <Graham.Dennis@gmail.com>
<http://bugzilla.opendarwin.org/show_bug.cgi?id=7245>
......@@ -77,23 +85,6 @@
* fast/replaced/resources/1x1-blue.png: Added.
* fast/replaced/resources/square-blue-100x100.png: Added.
2006-02-21 Sam Weinig <sam.weinig@gmail.com>
Reviewed by Hyatt.
-tests for http://bugzilla.opendarwin.org/show_bug.cgi?id=5146
* fast/replaced/maxheight-percent.html: Added.
* fast/replaced/maxheight-pxs.html: Added.
* fast/replaced/maxwidth-percent.html: Added.
* fast/replaced/maxwidth-pxs.html: Added.
* fast/replaced/minheight-percent.html: Added.
* fast/replaced/minheight-pxs.html: Added.
* fast/replaced/minwidth-percent.html: Added.
* fast/replaced/minwidth-pxs.html: Added.
* fast/replaced/resources/1x1-blue.png: Added.
* fast/replaced/resources/square-blue-100x100.png: Added.
2006-02-24 Alexey Proskuryakov <ap@nypop.com>
Reviewed by Darin.
......
Hooray, you got here! That means the test succeeded!
<meta http-equiv="refresh" content="0;URL=resources/destination.html">
<script>
if (window.layoutTestController) {
layoutTestController.waitUntilDone();
layoutTestController.dumpAsText();
}
setTimeout("window.location.replace('resources/destination.html')", 0)
</script>
2006-02-24 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fix <rdar://problem/4456287> REGRESSION: assertion failure at mypage.apple.com
in WebCore::TimerBase::nextFireInterval() const + 100 (Timer.cpp:188)
Test: fast/dom/Window/redirect-with-timer.html
* platform/Timer.h: Made isActive no longer inline. Added inHeap function.
* platform/Timer.cpp: Changed assertions to use inHeap function for clarity.
(WebCore::TimerBase::isActive): Return true for timers that are ready to fire.
They have a next fire time of 0, but they should still be considered active.
(WebCore::TimerBase::checkConsistency): Correct the consistency check. The new
rule is that timers with a next fire time of 0 are not in the heap, and all other
timers are.
2006-02-24 Graham Dennis <Graham.Dennis@gmail.com>
 
<http://bugzilla.opendarwin.org/show_bug.cgi?id=7245>
......
......@@ -164,7 +164,7 @@ TimerBase::~TimerBase()
{
stop();
ASSERT(m_heapIndex == -1);
ASSERT(!inHeap());
}
void TimerBase::start(double nextFireInterval, double repeatInterval)
......@@ -180,7 +180,12 @@ void TimerBase::stop()
ASSERT(m_nextFireTime == 0);
ASSERT(m_repeatInterval == 0);
ASSERT(m_heapIndex == -1);
ASSERT(!inHeap());
}
bool TimerBase::isActive() const
{
return m_nextFireTime || (timersReadyToFire && timersReadyToFire->contains(this));
}
double TimerBase::nextFireInterval() const
......@@ -203,10 +208,9 @@ inline void TimerBase::checkHeapIndex() const
inline void TimerBase::checkConsistency() const
{
// Active timers must be in the heap or the "ready to fire set".
// But timers that do have a next-fire time must be in either one or the other.
ASSERT(isActive() == (m_heapIndex != -1 || (timersReadyToFire && timersReadyToFire->contains(this))));
if (m_heapIndex != -1)
// Timers should be in the heap if and only if they have a non-zero next fire time.
ASSERT(inHeap() == (m_nextFireTime != 0));
if (inHeap())
checkHeapIndex();
}
......@@ -243,7 +247,7 @@ inline void TimerBase::heapIncreaseKey()
inline void TimerBase::heapInsert()
{
ASSERT(m_heapIndex == -1);
ASSERT(!inHeap());
if (!timerHeap)
timerHeap = new Vector<TimerBase*>;
timerHeap->append(this);
......
......@@ -46,7 +46,7 @@ namespace WebCore {
void startOneShot(double interval) { start(interval, 0); }
void stop();
bool isActive() const { return m_nextFireTime; }
bool isActive() const;
double nextFireInterval() const;
double repeatInterval() const { return m_repeatInterval; }
......@@ -59,6 +59,8 @@ namespace WebCore {
void setNextFireTime(double);
bool inHeap() const { return m_heapIndex != -1; }
void heapDecreaseKey();
void heapDelete();
void heapDeleteMin();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment