[Webkit-unassigned] [Bug 31204] WebInspector: RR for unit test of timeline data

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Nov 6 14:19:00 PST 2009


https://bugs.webkit.org/show_bug.cgi?id=31204





--- Comment #8 from Eric Ayers <zundel at google.com>  2009-11-06 14:19:00 PDT ---
(In reply to comment #6)
...
> > 
> > The idea was not for 100ms, but to get behind other setTimeout(xxx,0) methods I
> > had setup in timline-test.js.
> > 
> 
> setTimeout(xxx, 0) just queues them. No need in numbers.

changed all timeouts to 0.

> > > > -    evaluateInWebInspector(toInject.join("\n"), doit);
> > > > +    doit();
> > > 
> > > It is important that doit is called after evaluateInWebInspector invoked its
> > > callback.
> > 
> > I modified the code so that the scripts are injected before the reload.   The
> > functions should have long been defined before we get to this point, or is it
> > that you want to defer execution of doit() until all of onload() has finished?
> 
> When page loads, it pushes dom into the frontend. The main idea is that test
> execution continues (and does doit) when frontend received that information,
> made additional async calls, received response and everything settles down.
> That's what you violate here.

added an executeInWebInspector() with a trivial body to invoke doit

> > > > +        }
> > > > +        markCurrentRecordAsOverhead("onload" + (ignoreLoad ? ":ignoreLoad": ""));
> > > > +    }, 1000);  // Give timer fires created in script a chance to run.  Is 1 second too long to delay?
> > > > +}
> > > 
> > > Again, time won't help. What is the goal here?
> > 
> > When I write a test script that does a timer fire, I want to make sure the
> > timer fire goes off before we try to pull down the timeline data.  I want to
> > queue up the analysis after all the other script activity we might perform,
> > like a timer fire or XHR.  I know testing XHR is going to be problematic.  What
> > do you suggest I do?
> > 
> 
> For timers, setTimeout(0) would queue the fires. Isn't it enough?

Now, the analysis occurs when you ask for it with retrieveTimelineData(). If
you ask for it in doit() it will run as soon as possible.


> > > I'd like to keep reload logic in one place. We can extend inspector-test to
> > > make it call into
> > > frontend_setUp early in the cycle.
> > 
> > Why don't we have a prefix like frontendSetup_ and inject and execute all of
> > those methods before reload?
> 
> Fine with me, but you would need to care about order. While explicit
> frontend_setup sounds inline with unit testing in general.

inspector-test.js now injects the functions before reload, and executes
frontend_setup() if it exists.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list